foreach ( $_['versions'] as $v ) { | foreach ( $_['versions'] as $v ) { | ||||
echo ' '; | echo ' '; | ||||
echo OCP\Util::formatDate( doubleval($v['version']) ); | echo OCP\Util::formatDate( doubleval($v['version']) ); | ||||
echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php', array('path' => urlencode( $_['path'] ), 'revert' => $v['version'])) .'" class="button">Revert</a><br /><br />'; | |||||
echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php', array('path' => $_['path'], 'revert' => $v['version'])) .'" class="button">Revert</a><br /><br />'; | |||||
if ( $v['cur'] ) { echo ' (<b>Current</b>)'; } | if ( $v['cur'] ) { echo ' (<b>Current</b>)'; } | ||||
echo '<br /><br />'; | echo '<br /><br />'; | ||||
} | } |
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) and isset($_POST['sectoken']) and isset($_SESSION['sectoken']) and ($_POST['sectoken']==$_SESSION['sectoken']) ) { | if (!empty($email) and isset($_POST['sectoken']) and isset($_SESSION['sectoken']) and ($_POST['sectoken']==$_SESSION['sectoken']) ) { | ||||
$link = OC_Helper::linkToAbsolute('core/lostpassword', 'resetpassword.php', array('user' => urlencode($_POST['user']), 'token' => $token)); | |||||
$link = OC_Helper::linkToAbsolute('core/lostpassword', 'resetpassword.php', array('user' => $_POST['user'], 'token' => $token)); | |||||
$tmpl = new OC_Template('core/lostpassword', 'email'); | $tmpl = new OC_Template('core/lostpassword', 'email'); | ||||
$tmpl->assign('link', $link, false); | $tmpl->assign('link', $link, false); | ||||
$msg = $tmpl->fetchPage(); | $msg = $tmpl->fetchPage(); |
* @param string $app app | * @param string $app app | ||||
* @param string $file file | * @param string $file file | ||||
* @param array $args array with param=>value, will be appended to the returned url | * @param array $args array with param=>value, will be appended to the returned url | ||||
* The value of $args will be urlencoded | |||||
* @return string the url | * @return string the url | ||||
* | * | ||||
* Returns a url to the given app and file. | * Returns a url to the given app and file. | ||||
if (!empty($args)) { | if (!empty($args)) { | ||||
$urlLinkTo .= '?'; | $urlLinkTo .= '?'; | ||||
foreach($args as $k => $v) { | foreach($args as $k => $v) { | ||||
$urlLinkTo .= '&'.$k.'='.$v; | |||||
$urlLinkTo .= '&'.$k.'='.urlencode($v); | |||||
} | } | ||||
} | } | ||||
* @param string $app app | * @param string $app app | ||||
* @param string $file file | * @param string $file file | ||||
* @param array $args array with param=>value, will be appended to the returned url | * @param array $args array with param=>value, will be appended to the returned url | ||||
* The value of $args will be urlencoded | |||||
* @return string the url | * @return string the url | ||||
* | * | ||||
* Returns a absolute url to the given app and file. | * Returns a absolute url to the given app and file. |
* @param $app app | * @param $app app | ||||
* @param $file file | * @param $file file | ||||
* @param $args array with param=>value, will be appended to the returned url | * @param $args array with param=>value, will be appended to the returned url | ||||
* The value of $args will be urlencoded | |||||
* @returns the url | * @returns the url | ||||
* | * | ||||
* Returns a absolute url to the given app and file. | * Returns a absolute url to the given app and file. | ||||
* @param $app app | * @param $app app | ||||
* @param $file file | * @param $file file | ||||
* @param $args array with param=>value, will be appended to the returned url | * @param $args array with param=>value, will be appended to the returned url | ||||
* The value of $args will be urlencoded | |||||
* @returns the url | * @returns the url | ||||
* | * | ||||
* Returns a url to the given app and file. | * Returns a url to the given app and file. |
$name = basename($path); | $name = basename($path); | ||||
$text = ''; | $text = ''; | ||||
$path = urlencode($path); | |||||
if($mime=='httpd/unix-directory') { | if($mime=='httpd/unix-directory') { | ||||
$link = OC_Helper::linkTo( 'files', 'index.php', array('dir' => $path)); | $link = OC_Helper::linkTo( 'files', 'index.php', array('dir' => $path)); | ||||
$type = 'Files'; | $type = 'Files'; |
public static function checkLoggedIn() { | public static function checkLoggedIn() { | ||||
// Check if we are a user | // Check if we are a user | ||||
if( !OC_User::isLoggedIn()) { | if( !OC_User::isLoggedIn()) { | ||||
header( 'Location: '.OC_Helper::linkToAbsolute( '', 'index.php', array('redirect_url' => urlencode($_SERVER["REQUEST_URI"])))); | |||||
header( 'Location: '.OC_Helper::linkToAbsolute( '', 'index.php', array('redirect_url' => $_SERVER["REQUEST_URI"]))); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } |