本文整理汇总了PHP中app::getClass方法的典型用法代码示例。如果您正苦于以下问题:PHP app::getClass方法的具体用法?PHP app::getClass怎么用?PHP app::getClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app
的用法示例。
在下文中一共展示了app::getClass方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setContent
public function setContent($html)
{
if (\app::getClass('user')->VerifyConnexion() && $_SESSION['permissions'] & 128) {
/* perm 128 = configure blocks */
return \tools::file_put_contents(PROFILE_PATH . $this->getConfig('viewPath'), \tools::sanitize($html));
}
return FALSE;
}
示例2: t
?>
</div>
<!-- NESTED COMMENTS ANSWER -->
</li>
<?php
}
?>
<?php
}
?>
</ul>
<?php
// if config provides that user must me connected
if ($configs['loggedin'] == "1") {
// check if user connected
if (\app::getClass('user')->VerifyConnexion()) {
// Post a comment
?>
<h4 class="title"><?php
echo t('Post a comment');
?>
</h4>
<?php
// Tpl: Login as & comment form
?>
<div class="userInfo">
<?php
echo t('Connected as') . ' <span>' . \app::$request->getParam('session_login') . '</span>';
?>
(<a class="logout" href="logout"><?php
示例3: renewPassAction
public function renewPassAction()
{
$mail = \app::$request->getParam('mail');
if ($mail !== FALSE && filter_var($mail, FILTER_VALIDATE_EMAIL)) {
return \app::getClass('user')->resetPassword(filter_var($mail, FILTER_VALIDATE_EMAIL));
} else {
return t('Invalid E-mail');
}
}
示例4: function
CFInstall.check({
mode: "inline", // the default
oninstall: function(){
alert("Chrome Frame is now installed. Restart your browser to start enjoying Parsimony!");
}
});
});
</script>
<![endif]-->
<?php
if (\app::getClass('user')->VerifyConnexion()) {
header('Location: ' . BASE_PATH . 'index');
exit;
}
if (isset($_POST['connexion'])) {
$user = \app::getClass('user');
$user->authentication($_POST['login'], $_POST['password']);
if ($user->VerifyConnexion()) {
header('Location: ' . BASE_PATH);
exit;
} else {
echo '<div id="wrong">' . t('The username or password you entered is incorrect') . '</div>';
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title><?php
echo t('Login');
?>
示例5: determineRole
/**
* Determine Role & permissions
*/
protected function determineRole()
{
/* Rights */
define('DISPLAY', 1);
define('INSERT', 2);
define('UPDATE', 4);
define('DELETE', 8);
if (\app::getClass('user')->VerifyConnexion() === TRUE && (empty(app::$config['security']['allowedipadmin']) || preg_match('@' . preg_quote($_SERVER['REMOTE_ADDR'], '.') . '@', app::$config['security']['allowedipadmin']))) {
/* Mainly to use in query block, session_ prefix to avoid collision */
$this->setParams(array('session_id_user' => $_SESSION['id_user'], 'session_id_role' => $_SESSION['id_role'], 'session_permissions' => $_SESSION['permissions'], 'session_login' => $_SESSION['login']));
if ($_SESSION['permissions'] > 0) {
/* If user is a creator we display errors and active admin module */
\app::$activeModules['admin'] = 1;
error_reporting(-1);
ini_set('display_errors', 1);
set_error_handler('\\core\\classes\\app::errorHandler');
set_exception_handler('\\core\\classes\\app::exceptionHandler');
register_shutdown_function('\\core\\classes\\app::errorHandlerFatal');
}
} else {
$_SESSION['permissions'] = 0;
$_SESSION['id_role'] = 4;
/* Mainly to use in query block */
$this->setParams(array('session_id_user' => FALSE, 'session_id_role' => 4, 'session_permissions' => 0, 'session_login' => FALSE));
}
define('TOKEN', $_SESSION['TOKEN']);
}