예제 #1
0
 public static function sendEmail($args)
 {
     $isEncrypted = OC_App::isEnabled('files_encryption');
     if (!$isEncrypted || isset($_POST['continue'])) {
         $continue = true;
     } else {
         $continue = false;
     }
     if (OC_User::userExists($_POST['user']) && $continue) {
         $token = hash('sha256', OC_Util::generate_random_bytes(30) . OC_Config::getValue('passwordsalt', ''));
         OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', hash('sha256', $token));
         // Hash the token again to prevent timing attacks
         $email = OC_Preferences::getValue($_POST['user'], 'settings', 'email', '');
         if (!empty($email)) {
             $link = OC_Helper::linkToRoute('core_lostpassword_reset', array('user' => $_POST['user'], 'token' => $token));
             $link = OC_Helper::makeURLAbsolute($link);
             $tmpl = new OC_Template('core/lostpassword', 'email');
             $tmpl->assign('link', $link, false);
             $msg = $tmpl->fetchPage();
             $l = OC_L10N::get('core');
             $from = OCP\Util::getDefaultEmailAddress('lostpassword-noreply');
             try {
                 OC_Mail::send($email, $_POST['user'], $l->t('ownCloud password reset'), $msg, $from, 'ownCloud');
             } catch (Exception $e) {
                 OC_Template::printErrorPage('A problem occurs during sending the e-mail please contact your administrator.');
             }
             self::displayLostPasswordPage(false, true);
         } else {
             self::displayLostPasswordPage(true, false);
         }
     } else {
         self::displayLostPasswordPage(true, false);
     }
 }
예제 #2
0
 public static function sendEmail($args)
 {
     if (OC_User::userExists($_POST['user'])) {
         $token = hash('sha256', OC_Util::generate_random_bytes(30) . OC_Config::getValue('passwordsalt', ''));
         OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', hash('sha256', $token));
         // Hash the token again to prevent timing attacks
         $email = OC_Preferences::getValue($_POST['user'], 'settings', 'email', '');
         if (!empty($email)) {
             $link = OC_Helper::linkToRoute('core_lostpassword_reset', array('user' => $_POST['user'], 'token' => $token));
             $link = OC_Helper::makeURLAbsolute($link);
             $tmpl = new OC_Template('core/lostpassword', 'email');
             $tmpl->assign('link', $link, false);
             $msg = $tmpl->fetchPage();
             $l = OC_L10N::get('core');
             $from = 'lostpassword-noreply@' . OCP\Util::getServerHost();
             OC_Mail::send($email, $_POST['user'], $l->t('ownCloud password reset'), $msg, $from, 'ownCloud');
             echo 'Mailsent';
             self::displayLostPasswordPage(false, true);
         } else {
             self::displayLostPasswordPage(true, false);
         }
     } else {
         self::displayLostPasswordPage(true, false);
     }
 }
예제 #3
0
 function search($query)
 {
     $files = \OC\Files\Filesystem::search($query, true);
     $results = array();
     $l = OC_L10N::get('lib');
     foreach ($files as $fileData) {
         $path = $fileData['path'];
         $mime = $fileData['mimetype'];
         $name = basename($path);
         $container = dirname($path);
         $text = '';
         $skip = false;
         if ($mime == 'httpd/unix-directory') {
             $link = OC_Helper::linkTo('files', 'index.php', array('dir' => $path));
             $type = (string) $l->t('Files');
         } else {
             $link = OC_Helper::linkToRoute('download', array('file' => $path));
             $mimeBase = $fileData['mimepart'];
             switch ($mimeBase) {
                 case 'audio':
                     $skip = true;
                     break;
                 case 'text':
                     $type = (string) $l->t('Text');
                     break;
                 case 'image':
                     $type = (string) $l->t('Images');
                     break;
                 default:
                     if ($mime == 'application/xml') {
                         $type = (string) $l->t('Text');
                     } else {
                         $type = (string) $l->t('Files');
                     }
             }
         }
         if (!$skip) {
             $results[] = new OC_Search_Result($name, $text, $link, $type, $container);
         }
     }
     return $results;
 }
예제 #4
0
파일: pdf.php 프로젝트: CDN-Sparks/owncloud
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

	<link rel="stylesheet" href="<?php 
print_unescaped(OC_Helper::linkTo('files_pdfviewer', '3rdparty/pdfjs/viewer.css'));
?>
"/>
	
	<!-- oC changes-->
	<script type="text/javascript" src="<?php 
print_unescaped(OC_Helper::linkTo('core', 'js/jquery-1.7.2.min.js'));
?>
"></script>
	<script type="text/javascript" src="<?php 
print_unescaped(OC_Helper::linkToRoute('js_config'));
?>
"></script>
	<script type="text/javascript" src="<?php 
print_unescaped(OC_Helper::linkTo('core', 'js/oc-dialogs.js'));
?>
"></script>
	<script type="text/javascript" src="<?php 
print_unescaped(OC_Helper::linkTo('core', 'js/js.js'));
?>
"></script>
	<!-- oC changes -->

	<script type="text/javascript" src="<?php 
print_unescaped(OC_Helper::linkTo('files_pdfviewer', '3rdparty/pdfjs/compatibility.js'));
?>
예제 #5
0
 /**
  * Creates an url using a defined route
  * @param string $route
  * @param array $parameters
  * @internal param array $args with param=>value, will be appended to the returned url
  * @return string the url
  * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->linkToRoute($route, $parameters)
  * @since 5.0.0
  */
 public static function linkToRoute($route, $parameters = array())
 {
     return \OC_Helper::linkToRoute($route, $parameters);
 }
예제 #6
0
 /**
  * @param string $renderAs
  * @param string $appId application id
  */
 public function __construct($renderAs, $appId = '')
 {
     // yes - should be injected ....
     $this->config = \OC::$server->getConfig();
     // Decide which page we show
     if ($renderAs == 'user') {
         parent::__construct('core', 'layout.user');
         if (in_array(OC_App::getCurrentApp(), ['settings', 'admin', 'help']) !== false) {
             $this->assign('bodyid', 'body-settings');
         } else {
             $this->assign('bodyid', 'body-user');
         }
         // Update notification
         if ($this->config->getSystemValue('updatechecker', true) === true && OC_User::isAdminUser(OC_User::getUser())) {
             $updater = new \OC\Updater(\OC::$server->getHTTPHelper(), \OC::$server->getConfig());
             $data = $updater->check();
             if (isset($data['version']) && $data['version'] != '' and $data['version'] !== array()) {
                 $this->assign('updateAvailable', true);
                 $this->assign('updateVersion', $data['versionstring']);
                 $this->assign('updateLink', $data['web']);
                 \OCP\Util::addScript('core', 'update-notification');
             } else {
                 $this->assign('updateAvailable', false);
                 // No update available or not an admin user
             }
         } else {
             $this->assign('updateAvailable', false);
             // Update check is disabled
         }
         // Add navigation entry
         $this->assign('application', '');
         $this->assign('appid', $appId);
         $navigation = OC_App::getNavigation();
         $this->assign('navigation', $navigation);
         $settingsNavigation = OC_App::getSettingsNavigation();
         $this->assign('settingsnavigation', $settingsNavigation);
         foreach ($navigation as $entry) {
             if ($entry['active']) {
                 $this->assign('application', $entry['name']);
                 break;
             }
         }
         foreach ($settingsNavigation as $entry) {
             if ($entry['active']) {
                 $this->assign('application', $entry['name']);
                 break;
             }
         }
         $userDisplayName = OC_User::getDisplayName();
         $this->assign('user_displayname', $userDisplayName);
         $this->assign('user_uid', OC_User::getUser());
         $this->assign('appsmanagement_active', strpos(\OC::$server->getRequest()->getRequestUri(), \OC::$server->getURLGenerator()->linkToRoute('settings.AppSettings.viewApps')) === 0);
         $this->assign('enableAvatars', $this->config->getSystemValue('enable_avatars', true));
         $this->assign('userAvatarSet', \OC_Helper::userAvatarSet(OC_User::getUser()));
     } else {
         if ($renderAs == 'error') {
             parent::__construct('core', 'layout.guest', '', false);
             $this->assign('bodyid', 'body-login');
         } else {
             if ($renderAs == 'guest') {
                 parent::__construct('core', 'layout.guest');
                 $this->assign('bodyid', 'body-login');
             } else {
                 parent::__construct('core', 'layout.base');
             }
         }
     }
     // Send the language to our layouts
     $this->assign('language', OC_L10N::findLanguage());
     if (empty(self::$versionHash)) {
         $v = OC_App::getAppVersions();
         $v['core'] = implode('.', \OC_Util::getVersion());
         self::$versionHash = md5(implode(',', $v));
     }
     $useAssetPipeline = self::isAssetPipelineEnabled();
     if ($useAssetPipeline) {
         $this->append('jsfiles', OC_Helper::linkToRoute('js_config', array('v' => self::$versionHash)));
         $this->generateAssets();
     } else {
         // Add the js files
         $jsFiles = self::findJavascriptFiles(OC_Util::$scripts);
         $this->assign('jsfiles', array(), false);
         if ($this->config->getSystemValue('installed', false) && $renderAs != 'error') {
             $this->append('jsfiles', OC_Helper::linkToRoute('js_config', array('v' => self::$versionHash)));
         }
         foreach ($jsFiles as $info) {
             $web = $info[1];
             $file = $info[2];
             $this->append('jsfiles', $web . '/' . $file . '?v=' . self::$versionHash);
         }
         // Add the css files
         $cssFiles = self::findStylesheetFiles(OC_Util::$styles);
         $this->assign('cssfiles', array());
         foreach ($cssFiles as $info) {
             $web = $info[1];
             $file = $info[2];
             $this->append('cssfiles', $web . '/' . $file . '?v=' . self::$versionHash);
         }
     }
 }
예제 #7
0
 public static function preview_icon($path)
 {
     return \OC_Helper::linkToRoute('core_ajax_trashbin_preview', array('x' => 36, 'y' => 36, 'file' => $path));
 }
예제 #8
0
 public function finishSetup()
 {
     header('Location: ' . \OC_Helper::linkToRoute('post_setup_check'));
     exit;
 }
예제 #9
0
}
OC_Util::addScript('setup');
$hasSQLite = class_exists('SQLite3');
$hasMySQL = is_callable('mysql_connect');
$hasPostgreSQL = is_callable('pg_connect');
$hasOracle = is_callable('oci_connect');
$hasMSSQL = is_callable('sqlsrv_connect');
$datadir = OC_Config::getValue('datadirectory', OC::$SERVERROOT . '/data');
$vulnerableToNullByte = false;
if (@file_exists(__FILE__ . "Nullbyte")) {
    // Check if the used PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243)
    $vulnerableToNullByte = true;
}
// Protect data directory here, so we can test if the protection is working
OC_Setup::protectDataDirectory();
$opts = array('hasSQLite' => $hasSQLite, 'hasMySQL' => $hasMySQL, 'hasPostgreSQL' => $hasPostgreSQL, 'hasOracle' => $hasOracle, 'hasMSSQL' => $hasMSSQL, 'directory' => $datadir, 'secureRNG' => OC_Util::secureRNGAvailable(), 'htaccessWorking' => OC_Util::isHtAccessWorking(), 'vulnerableToNullByte' => $vulnerableToNullByte, 'errors' => array(), 'dbIsSet' => $dbIsSet, 'directoryIsSet' => $directoryIsSet);
if (isset($_POST['install']) and $_POST['install'] == 'true') {
    // We have to launch the installation process :
    $e = OC_Setup::install($_POST);
    $errors = array('errors' => $e);
    if (count($e) > 0) {
        //OC_Template::printGuestPage("", "error", array("errors" => $errors));
        $options = array_merge($_POST, $opts, $errors);
        OC_Template::printGuestPage("", "installation", $options);
    } else {
        header('Location: ' . OC_Helper::linkToRoute('post_setup_check'));
        exit;
    }
} else {
    OC_Template::printGuestPage("", "installation", $opts);
}
예제 #10
0
<?php

\OCP\Util::addStyle('registration', 'style');
?>
<form action="<?php 
print_unescaped(OC_Helper::linkToRoute('registration.register.createAccount', array('token' => $_['token'])));
?>
" method="post">
	<input type="hidden" name="requesttoken" value="<?php 
p($_['requesttoken']);
?>
" />
	<fieldset>
		<?php 
if ($_['errormsgs']) {
    ?>
		<ul class="error">
			<?php 
    foreach ($_['errormsgs'] as $errormsg) {
        echo "<li>{$errormsg}</li>";
    }
    ?>
		</ul>
		<?php 
} else {
    ?>
		<ul class="msg">
			<li><?php 
    print_unescaped($l->t('Welcome, you can create your account below.'));
    ?>
</li>
예제 #11
0
<?php

//load the file we need
OCP\Util::addStyle('lostpassword', 'lostpassword');
if ($_['requested']) {
    ?>
		<div class="update"><p>
	<?php 
    print_unescaped($l->t('The link to reset your password has been sent to your email.<br>If you do not receive it within a reasonable amount of time, check your spam/junk folders.<br>If it is not there ask your local administrator .'));
    ?>
	</p></div>
<?php 
} else {
    ?>
	<form action="<?php 
    print_unescaped(OC_Helper::linkToRoute('core_lostpassword_send_email'));
    ?>
" method="post">
		<fieldset>
			<?php 
    if ($_['error']) {
        ?>
				<div class="error"><p>
				<?php 
        print_unescaped($l->t('Request failed!<br>Did you make sure your email/username was right?'));
        ?>
				</p></div>
			<?php 
    }
    ?>
			<div class="update"><?php 
예제 #12
0
파일: login.php 프로젝트: ryanshoover/core
    echo $l->t('If you did not change your password recently, your account may be compromised!');
    ?>
</small><br>
				<small><?php 
    echo $l->t('Please change your password to secure your account again.');
    ?>
</small>
			</li>
		<?php 
}
?>
		<?php 
if (isset($_['invalidpassword']) && $_['invalidpassword']) {
    ?>
			<a href="<?php 
    echo OC_Helper::linkToRoute('core_lostpassword_index');
    ?>
"><li class="errors">
				<?php 
    echo $l->t('Lost your password?');
    ?>
			</li></a>
		<?php 
}
?>
		</ul>
		<p class="infield">
			<label for="user" class="infield"><?php 
echo $l->t('Username');
?>
</label>
예제 #13
0
    p($entry['name']);
    ?>
							</span>
						</a>
					</li>
				<?php 
}
?>

				<!-- show "More apps" link to app administration directly in app navigation, as last entry -->
				<?php 
if (OC_User::isAdminUser(OC_User::getUser())) {
    ?>
					<li id="apps-management">
						<a href="<?php 
    print_unescaped(OC_Helper::linkToRoute('settings_apps'));
    ?>
" title=""
							<?php 
    if ($_['appsmanagement_active']) {
        ?>
 class="active"<?php 
    }
    ?>
>
							<img class="app-icon svg" alt="" src="<?php 
    print_unescaped(OC_Helper::imagePath('settings', 'apps.svg'));
    ?>
"/>
							<div class="icon-loading-dark" style="display:none;"></div>
							<span>
예제 #14
0
 * Copyright (c) 2011, Robin Appelman <*****@*****.**>
 * This file is licensed under the Affero General Public License version 3 or later.
 * See the COPYING-README file.
 */
$allGroups = array();
foreach ($_["groups"] as $group) {
    $allGroups[] = $group['name'];
}
$_['subadmingroups'] = $allGroups;
$items = array_flip($_['subadmingroups']);
unset($items['admin']);
$_['subadmingroups'] = array_flip($items);
?>

<script type="text/javascript" src="<?php 
print_unescaped(OC_Helper::linkToRoute('isadmin'));
?>
"></script>

<table class="hascontrols grid" data-groups="<?php 
p(json_encode($allGroups));
?>
">
	<thead>
		<tr>
			<?php 
if ($_['enableAvatars']) {
    ?>
			<th id='headerAvatar' style="text-align:center;width:50px;"></th>
			<?php 
}
        print_unescaped(image_path('', 'actions/mail.svg'));
        ?>
" alt=""/>
				</p>
				<input type="submit" id="submit" value="<?php 
        print_unescaped($l->t('Request verification link'));
        ?>
" />
			</fieldset>
		</form>
	<?php 
    }
} else {
    ?>
	<form action="<?php 
    print_unescaped(OC_Helper::linkToRoute('registration.register.validateEmail'));
    ?>
" method="post">
		<fieldset>
			<?php 
    if ($_['errormsg']) {
        ?>
				<ul class="error">
					<li><?php 
        print_unescaped($_['errormsg']);
        ?>
</li>
					<li><?php 
        print_unescaped($l->t('Please re-enter a valid email address'));
        ?>
</li>
예제 #16
0
파일: api.php 프로젝트: nanowish/apps
 /**
  * Returns the URL for a route
  * @return the url
  */
 public function linkToRoute($routeName)
 {
     return \OC_Helper::linkToRoute($routeName);
 }
예제 #17
0
파일: app.php 프로젝트: netcon-source/apps
<?php

/**
* ownCloud - App Template plugin
*
* @author Bernhard Posselt
* @copyright 2012 Bernhard Posselt nukeawhale@gmail.com 
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
*
*/
require_once \OC_App::getAppPath('apptemplate_advanced') . '/appinfo/bootstrap.php';
\OCP\App::registerAdmin('apptemplate_advanced', 'admin/settings');
\OCP\App::addNavigationEntry(array('id' => 'apptemplate_advanced', 'order' => 74, 'href' => \OC_Helper::linkToRoute('apptemplate_advanced_index'), 'icon' => \OCP\Util::imagePath('apptemplate_advanced', 'example.png'), 'name' => \OC_L10N::get('apptemplate_advanced')->t('Advanced App Template')));
예제 #18
0
	public static function getUserAvatar( $user )
	{
		if ( ! array_key_exists($user, self::$avatars) ) {
			$avatar = New OC_Avatar($user);
			$image = $avatar->get(32);
			if ($image instanceof OC_Image) {
				$imageUrl = OC_Helper::linkToRoute ( 'core_avatar_get', array ('user' => $user, 'size' => 32) ) . '?requesttoken='. OC::$session->get('requesttoken');
				self::$avatars[$user] = $imageUrl;
			} else {
				self::$avatars[$user] = '';
			}
		}

		if ( self::$avatars[$user] != '' )
			return self::$avatars[$user];
		return '';
	}
예제 #19
0
				<?php 
if (OC_User::isAdminUser(OC_User::getUser())) {
    ?>
					<div class="push"></div><!-- for for sticky footer of apps management -->
				<?php 
}
?>
				</div>

				<!-- show "More apps" link to app administration directly in app navigation, as sticky footer -->
				<?php 
if (OC_User::isAdminUser(OC_User::getUser())) {
    ?>
					<!--li id="apps-management">
						<a href="<?php 
    print_unescaped(OC_Helper::linkToRoute('settings_apps') . '?installed');
    ?>
" title=""
							<?php 
    if ($entry['active']) {
        ?>
 class="active"<?php 
    }
    ?>
>
							<img class="icon svg" src="<?php 
    print_unescaped(OC_Helper::imagePath('settings', 'apps.svg'));
    ?>
"/>
							<span>
								<?php 
예제 #20
0
<form action="<?php 
echo OC_Helper::linkToRoute('core_lostpassword_reset', $_['args']);
?>
" method="post">
	<fieldset>
		<?php 
if ($_['success']) {
    ?>
			<h1><?php 
    echo $l->t('Your password was reset');
    ?>
</h1>
			<p><a href="<?php 
    echo OC_Helper::linkTo('', 'index.php');
    ?>
/"><?php 
    echo $l->t('To login page');
    ?>
</a></p>
		<?php 
} else {
    ?>
			<p class="infield">
				<label for="password" class="infield"><?php 
    echo $l->t('New password');
    ?>
</label>
				<input type="password" name="password" id="password" value="" required />
			</p>
			<input type="submit" id="submit" value="<?php 
    echo $l->t('Reset password');
예제 #21
0
<?php

/**
 * Copyright (c) 2011, Robin Appelman <*****@*****.**>
 * This file is licensed under the Affero General Public License version 3 or later.
 * See the COPYING-README file.
 */
?>
 <script type="text/javascript"
	src="<?php 
print_unescaped(OC_Helper::linkToRoute('apps_custom'));
?>
?appid=<?php 
p($_['appid']);
?>
"></script>
 <script type="text/javascript" src="<?php 
print_unescaped(OC_Helper::linkTo('settings/js', 'apps.js'));
?>
"></script>

<div id="controls">
	<a class="button" target="_blank" href="http://owncloud.org/dev"><?php 
p($l->t('Add your App'));
?>
</a>
	<a class="button" target="_blank" href="http://apps.owncloud.com"><?php 
p($l->t('More Apps'));
?>
</a>
</div>
예제 #22
0
" /><span class="msg"></span><br />
		<em><?php 
    p($l->t('Fill in an email address to enable password recovery'));
    ?>
</em>
	</fieldset>
</form>
<?php 
}
?>

<?php 
if ($_['enableAvatars']) {
    ?>
<form id="avatar" method="post" action="<?php 
    p(\OC_Helper::linkToRoute('core_avatar_post'));
    ?>
">
	<fieldset class="personalblock">
		<h2><?php 
    p($l->t('Profile picture'));
    ?>
</h2>
		<div id="displayavatar">
			<div class="avatardiv"></div><br>
			<div class="warning hidden"></div>
			<?php 
    if ($_['avatarChangeSupported']) {
        ?>
			<div class="inlineblock button" id="uploadavatarbutton"><?php 
        p($l->t('Upload new'));
예제 #23
0
	<p><?php 
p($l->t('You are member of the following groups:'));
?>
</p>
	<p>
	<?php 
p(implode(', ', $_['groups']));
?>
	</p>
</div>

<?php 
if ($_['enableAvatars']) {
    ?>
<form id="avatar" class="section" method="post" action="<?php 
    p(\OC_Helper::linkToRoute('core.avatar.postAvatar'));
    ?>
">
	<h2><?php 
    p($l->t('Profile picture'));
    ?>
</h2>
	<div id="displayavatar">
		<div class="avatardiv"></div><br>
		<div class="warning hidden"></div>
		<?php 
    if ($_['avatarChangeSupported']) {
        ?>
		<div class="inlineblock button" id="uploadavatarbutton"><?php 
        p($l->t('Upload new'));
        ?>
예제 #24
0
<ul>
	<li class='error'>
		<?php 
$location = \OC_Helper::linkToRoute("settings_personal") . '#changePKPasswd';
?>

		<?php 
p($_['message']);
?>
		<br/>
		<?php 
if ($_['errorCode'] === \OCA\Files_Encryption\Crypt::ENCRYPTION_PRIVATE_KEY_NOT_VALID_ERROR) {
    ?>
			<?php 
    p($l->t('Go directly to your %spersonal settings%s.', array('<a href="' . $location . '">', '</a>')));
    ?>
		<?php 
}
?>
		<br/>
	</li>
</ul>
예제 #25
0
<form action="<?php 
echo OC_Helper::linkToRoute('core_lostpassword_send_email');
?>
" method="post">
	<fieldset>
		<?php 
echo $l->t('You will receive a link to reset your password via Email.');
?>
		<?php 
if ($_['requested']) {
    ?>
			<?php 
    echo $l->t('Reset email send.');
    ?>
		<?php 
} else {
    ?>
			<?php 
    if ($_['error']) {
        ?>
				<?php 
        echo $l->t('Request failed!');
        ?>
			<?php 
    }
    ?>
			<p class="infield">
				<label for="user" class="infield"><?php 
    echo $l->t('Username');
    ?>
</label>
예제 #26
0
 />
			<label for="password" class="infield"><?php 
p($l->t('Password'));
?>
</label>
			<img class="svg" id="password-icon" src="<?php 
print_unescaped(image_path('', 'actions/password.svg'));
?>
" alt=""/>
		</p>

		<?php 
if (isset($_['invalidpassword']) && $_['invalidpassword']) {
    ?>
		<a class="warning" href="<?php 
    print_unescaped(OC_Helper::linkToRoute('core_lostpassword_index'));
    ?>
">
			<?php 
    p($l->t('Lost your password?'));
    ?>
		</a>
		<?php 
}
?>
		<?php 
if ($_['rememberLoginAllowed'] === true) {
    ?>
		<input type="checkbox" name="remember_login" value="1" id="remember_login" checked />
		<label for="remember_login"><?php 
    p($l->t('remember'));
예제 #27
0
    ?>
"
											 class="svg action"
											 src="<?php 
    print_unescaped(image_path('core', 'actions/delete.svg'));
    ?>
"/>
					</td>
				</tr>
			<?php 
}
?>
		</tbody>
	</table>
	<form class="uploadButton" method="post" action="<?php 
p(\OC_Helper::linkToRoute('settings_cert_post'));
?>
" target="certUploadFrame">
		<input type="file" id="rootcert_import" name="rootcert_import" class="hidden">
		<input type="button" id="rootcert_import_button" value="<?php 
p($l->t('Import Root Certificate'));
?>
"/>
	</form>
</div>

<?php 
if ($_['enableDecryptAll']) {
    ?>
<div id="encryption" class="section">
예제 #28
0
 /**
  * @param string $renderas
  * @param string $appid application id
  */
 public function __construct($renderas, $appid = '')
 {
     // Decide which page we show
     if ($renderas == 'user') {
         parent::__construct('core', 'layout.user');
         if (in_array(OC_APP::getCurrentApp(), array('settings', 'admin', 'help')) !== false) {
             $this->assign('bodyid', 'body-settings');
         } else {
             $this->assign('bodyid', 'body-user');
         }
         // Update notification
         if (OC_Config::getValue('updatechecker', true) === true) {
             $data = OC_Updater::check();
             if (isset($data['version']) && $data['version'] != '' and $data['version'] !== array() && OC_User::isAdminUser(OC_User::getUser())) {
                 $this->assign('updateAvailable', true);
                 $this->assign('updateVersion', $data['versionstring']);
                 $this->assign('updateLink', $data['web']);
             } else {
                 $this->assign('updateAvailable', false);
                 // No update available or not an admin user
             }
         } else {
             $this->assign('updateAvailable', false);
             // Update check is disabled
         }
         // Add navigation entry
         $this->assign('application', '', false);
         $this->assign('appid', $appid);
         $navigation = OC_App::getNavigation();
         $this->assign('navigation', $navigation);
         $this->assign('settingsnavigation', OC_App::getSettingsNavigation());
         foreach ($navigation as $entry) {
             if ($entry['active']) {
                 $this->assign('application', $entry['name']);
                 break;
             }
         }
         $user_displayname = OC_User::getDisplayName();
         $this->assign('user_displayname', $user_displayname);
         $this->assign('user_uid', OC_User::getUser());
         $this->assign('appsmanagement_active', strpos(OC_Request::requestUri(), OC_Helper::linkToRoute('settings_apps')) === 0);
         $this->assign('enableAvatars', \OC_Config::getValue('enable_avatars', true));
     } else {
         if ($renderas == 'error') {
             parent::__construct('core', 'layout.guest', '', false);
         } else {
             if ($renderas == 'guest') {
                 parent::__construct('core', 'layout.guest');
             } else {
                 parent::__construct('core', 'layout.base');
             }
         }
     }
     $versionParameter = '?v=' . md5(implode(OC_Util::getVersion()));
     $useAssetPipeline = $this->isAssetPipelineEnabled();
     if ($useAssetPipeline) {
         $this->append('jsfiles', OC_Helper::linkToRoute('js_config') . $versionParameter);
         $this->generateAssets();
     } else {
         // Add the js files
         $jsfiles = self::findJavascriptFiles(OC_Util::$scripts);
         $this->assign('jsfiles', array(), false);
         if (OC_Config::getValue('installed', false) && $renderas != 'error') {
             $this->append('jsfiles', OC_Helper::linkToRoute('js_config') . $versionParameter);
         }
         foreach ($jsfiles as $info) {
             $web = $info[1];
             $file = $info[2];
             $this->append('jsfiles', $web . '/' . $file . $versionParameter);
         }
         // Add the css files
         $cssfiles = self::findStylesheetFiles(OC_Util::$styles);
         $this->assign('cssfiles', array());
         foreach ($cssfiles as $info) {
             $web = $info[1];
             $file = $info[2];
             $this->append('cssfiles', $web . '/' . $file . $versionParameter);
         }
     }
 }
예제 #29
0
 /**
  * Returns the Settings Navigation
  * @return string
  *
  * This function returns an array containing all settings pages added. The
  * entries are sorted by the key 'order' ascending.
  */
 public static function getSettingsNavigation()
 {
     $l = \OC::$server->getL10N('lib');
     $settings = array();
     // by default, settings only contain the help menu
     if (OC_Util::getEditionString() === '' && OC_Config::getValue('knowledgebaseenabled', true) == true) {
         $settings = array(array("id" => "help", "order" => 1000, "href" => OC_Helper::linkToRoute("settings_help"), "name" => $l->t("Help"), "icon" => OC_Helper::imagePath("settings", "help.svg")));
     }
     // if the user is logged-in
     if (OC_User::isLoggedIn()) {
         // personal menu
         $settings[] = array("id" => "personal", "order" => 1, "href" => OC_Helper::linkToRoute("settings_personal"), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath("settings", "personal.svg"));
         // if there are some settings forms
         if (!empty(self::$settingsForms)) {
             // settings menu
             $settings[] = array("id" => "settings", "order" => 1000, "href" => OC_Helper::linkToRoute("settings_settings"), "name" => $l->t("Settings"), "icon" => OC_Helper::imagePath("settings", "settings.svg"));
         }
         //SubAdmins are also allowed to access user management
         if (OC_SubAdmin::isSubAdmin(OC_User::getUser())) {
             // admin users menu
             $settings[] = array("id" => "core_users", "order" => 2, "href" => OC_Helper::linkToRoute("settings_users"), "name" => $l->t("Users"), "icon" => OC_Helper::imagePath("settings", "users.svg"));
         }
         // if the user is an admin
         if (OC_User::isAdminUser(OC_User::getUser())) {
             // admin settings
             $settings[] = array("id" => "admin", "order" => 1000, "href" => OC_Helper::linkToRoute("settings_admin"), "name" => $l->t("Admin"), "icon" => OC_Helper::imagePath("settings", "admin.svg"));
         }
     }
     $navigation = self::proceedNavigation($settings);
     return $navigation;
 }
예제 #30
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */
OC_Util::checkLoggedIn();
// Load the files we need
OC_Util::addStyle("settings", "settings");
OC_App::setActiveNavigationEntry("help");
if (isset($_GET['mode']) and $_GET['mode'] === 'admin') {
    $url = OC_Helper::linkToAbsolute('core', 'doc/admin/index.html');
    $style1 = '';
    $style2 = ' active';
} else {
    $url = OC_Helper::linkToAbsolute('core', 'doc/user/index.html');
    $style1 = ' active';
    $style2 = '';
}
$url1 = OC_Helper::linkToRoute("settings_help") . '?mode=user';
$url2 = OC_Helper::linkToRoute("settings_help") . '?mode=admin';
$tmpl = new OC_Template("settings", "help", "user");
$tmpl->assign("admin", OC_User::isAdminUser(OC_User::getUser()));
$tmpl->assign("url", $url);
$tmpl->assign("url1", $url1);
$tmpl->assign("url2", $url2);
$tmpl->assign("style1", $style1);
$tmpl->assign("style2", $style2);
$tmpl->printPage();