Merge branch 'master' of gitorious.org:owncloud/owncloud
This commit is contained in:
commit
d96e962fc1
|
@ -0,0 +1,15 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once('../../../lib/base.php');
|
||||||
|
|
||||||
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('files_sharing');
|
||||||
|
$user = OC_User::getUser();
|
||||||
|
// TODO translations
|
||||||
|
$subject = $user + ' ' + 'shared a file with you';
|
||||||
|
$link = $_POST['link'] + '&f=' + $_POST['f'];
|
||||||
|
$text = $user + ' ' + 'shared the file' + ' ' + $_POST['f'] + ' ' + 'with you.' + ' ' + 'It is available for download here:' + ' ' + $link;
|
||||||
|
$fromaddress = OC_Preferences::getValue($user, 'settings', 'email', 'owncloud.org');
|
||||||
|
OC_Mail::send($_POST['toaddress'], $_POST['toaddress'], $subject, $text, $fromaddress, $user);
|
||||||
|
|
||||||
|
?>
|
|
@ -163,6 +163,9 @@ $(document).ready(function() {
|
||||||
data: data,
|
data: data,
|
||||||
success: function(){
|
success: function(){
|
||||||
$('#link').hide('blind');
|
$('#link').hide('blind');
|
||||||
|
$('#emailBreak').remove();
|
||||||
|
$('#email').hide('blind');
|
||||||
|
$('#emailButton').hide('blind');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -172,6 +175,14 @@ $(document).ready(function() {
|
||||||
$(this).focus();
|
$(this).focus();
|
||||||
$(this).select();
|
$(this).select();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#emailButton').live('click', function() {
|
||||||
|
$('#email').css('font-weight', 'bold');
|
||||||
|
$('#email').animate({ fontWeight: 'normal' }, 2000, function() {
|
||||||
|
$(this).val('');
|
||||||
|
}).val('Email sent');
|
||||||
|
$.post(OC.filePath('files_sharing','ajax','email.php'), 'toaddress='+$('#email').val()+'&link='+$('#link').val());
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function createDropdown(filename, files) {
|
function createDropdown(filename, files) {
|
||||||
|
@ -183,10 +194,12 @@ function createDropdown(filename, files) {
|
||||||
html += '<ul id="shared_list"></ul>';
|
html += '<ul id="shared_list"></ul>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
html += '<div id="public">';
|
html += '<div id="public">';
|
||||||
html += '<input type="checkbox" name="makelink" id="makelink" value="1" /><label for="makelink">make public</label>';
|
html += '<input type="checkbox" name="makelink" id="makelink" value="1" /><label for="makelink">Share with private link</label>';
|
||||||
//html += '<input type="checkbox" name="public_link_write" id="public_link_write" value="1" /><label for="public_link_write">allow upload</label>';
|
//html += '<input type="checkbox" name="public_link_write" id="public_link_write" value="1" /><label for="public_link_write">allow upload</label>';
|
||||||
html += '<br />';
|
html += '<br />';
|
||||||
html += '<input id="link" style="display:none; width:90%;" />';
|
html += '<input id="link" style="display:none; width:90%;" />';
|
||||||
|
html += '<input id="email" style="display:none; width:65%;" value="" placeholder="Email link to person" />';
|
||||||
|
html += '<input id="emailButton" style="display:none;" type="submit" value="Send" />';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
if (filename) {
|
if (filename) {
|
||||||
$('tr').filterAttr('data-file',filename).addClass('mouseOver');
|
$('tr').filterAttr('data-file',filename).addClass('mouseOver');
|
||||||
|
@ -241,5 +254,9 @@ function showPublicLink(token, file) {
|
||||||
$('#makelink').attr('checked', true);
|
$('#makelink').attr('checked', true);
|
||||||
$('#link').data('token', token);
|
$('#link').data('token', token);
|
||||||
$('#link').val(parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token+'&f='+file);
|
$('#link').val(parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token+'&f='+file);
|
||||||
$('#link').show('blind');
|
$('#link').show('blind', function() {
|
||||||
|
$('#link').after('<br id="emailBreak" />');
|
||||||
|
$('#email').show('blind');
|
||||||
|
$('#emailButton').show('blind');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,13 +9,14 @@
|
||||||
$RUNTIME_NOAPPS = TRUE; //no apps
|
$RUNTIME_NOAPPS = TRUE; //no apps
|
||||||
require_once('../../lib/base.php');
|
require_once('../../lib/base.php');
|
||||||
|
|
||||||
|
|
||||||
// Someone lost their password:
|
// Someone lost their password:
|
||||||
if (isset($_POST['user'])) {
|
if (isset($_POST['user'])) {
|
||||||
if (OC_User::userExists($_POST['user'])) {
|
if (OC_User::userExists($_POST['user'])) {
|
||||||
$token = sha1($_POST['user'].md5(uniqid(rand(), true)));
|
$token = sha1($_POST['user'].md5(uniqid(rand(), true)));
|
||||||
OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', $token);
|
OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', $token);
|
||||||
$email = OC_Preferences::getValue($_POST['user'], 'settings', 'email', '');
|
$email = OC_Preferences::getValue($_POST['user'], 'settings', 'email', '');
|
||||||
if (!empty($email)) {
|
if (!empty($email) and isset($_POST['sectoken']) and isset($_SESSION['sectoken']) and ($_POST['sectoken']==$_SESSION['sectoken']) ) {
|
||||||
$link = OC_Helper::linkToAbsolute('core/lostpassword', 'resetpassword.php').'?user='.$_POST['user'].'&token='.$token;
|
$link = OC_Helper::linkToAbsolute('core/lostpassword', 'resetpassword.php').'?user='.$_POST['user'].'&token='.$token;
|
||||||
$tmpl = new OC_Template('core/lostpassword', 'email');
|
$tmpl = new OC_Template('core/lostpassword', 'email');
|
||||||
$tmpl->assign('link', $link);
|
$tmpl->assign('link', $link);
|
||||||
|
@ -23,14 +24,20 @@ if (isset($_POST['user'])) {
|
||||||
$l = OC_L10N::get('core');
|
$l = OC_L10N::get('core');
|
||||||
$from = 'lostpassword-noreply@' . $_SERVER['HTTP_HOST'];
|
$from = 'lostpassword-noreply@' . $_SERVER['HTTP_HOST'];
|
||||||
$r=mail($email, $l->t('Owncloud password reset'), $msg, 'From:' . $from);
|
$r=mail($email, $l->t('Owncloud password reset'), $msg, 'From:' . $from);
|
||||||
//if($r==false) echo('error'); else echo('works!!!!!!!');
|
OC_MAIL::send($email,$_POST['user'],$l->t('ownCloud password reset'),$msg,$from,'ownCloud');
|
||||||
OC_MAIL::send($email,$_POST['user'],$l->t('Owncloud password reset'),$msg,$from,'ownCloud');
|
echo('sent');
|
||||||
|
|
||||||
}
|
}
|
||||||
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => false, 'requested' => true));
|
$sectoken=rand(1000000,9999999);
|
||||||
|
$_SESSION['sectoken']=$sectoken;
|
||||||
|
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => false, 'requested' => true, 'sectoken' => $sectoken));
|
||||||
} else {
|
} else {
|
||||||
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => true, 'requested' => false));
|
$sectoken=rand(1000000,9999999);
|
||||||
|
$_SESSION['sectoken']=$sectoken;
|
||||||
|
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => true, 'requested' => false, 'sectoken' => $sectoken));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => false, 'requested' => false));
|
$sectoken=rand(1000000,9999999);
|
||||||
|
$_SESSION['sectoken']=$sectoken;
|
||||||
|
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => false, 'requested' => false, 'sectoken' => $sectoken));
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<p class="infield">
|
<p class="infield">
|
||||||
<label for="user" class="infield"><?php echo $l->t( 'Username' ); ?></label>
|
<label for="user" class="infield"><?php echo $l->t( 'Username' ); ?></label>
|
||||||
<input type="text" name="user" id="user" value="" autocomplete="off" required autofocus />
|
<input type="text" name="user" id="user" value="" autocomplete="off" required autofocus />
|
||||||
|
<input type="hidden" name="sectoken" id="sectoken" value="<?php echo($_['sectoken']); ?>" />
|
||||||
</p>
|
</p>
|
||||||
<input type="submit" id="submit" value="<?php echo $l->t('Request reset'); ?>" />
|
<input type="submit" id="submit" value="<?php echo $l->t('Request reset'); ?>" />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
<div id="controls">
|
<div id="controls">
|
||||||
<a class="button newquestion" href="http://owncloud.org/support" target="_blank"><?php echo $l->t( 'Documentation' ); ?></a>
|
<a class="button newquestion" href="http://owncloud.org/support" target="_blank"><?php echo $l->t( 'Documentation' ); ?></a>
|
||||||
|
<a class="button newquestion" href="http://owncloud.org/support/big-files" target="_blank"><?php echo $l->t( 'Managing Big Files' ); ?></a>
|
||||||
<a class="button newquestion" href="http://apps.owncloud.com/knowledgebase/editquestion.php?action=new" target="_blank"><?php echo $l->t( 'Ask a question' ); ?></a>
|
<a class="button newquestion" href="http://apps.owncloud.com/knowledgebase/editquestion.php?action=new" target="_blank"><?php echo $l->t( 'Ask a question' ); ?></a>
|
||||||
<?php
|
<?php
|
||||||
$url=OC_Helper::linkTo( "settings", "help.php" ).'?page=';
|
$url=OC_Helper::linkTo( "settings", "help.php" ).'?page=';
|
||||||
|
|
Loading…
Reference in New Issue