本文整理汇总了PHP中Pommo::_auth方法的典型用法代码示例。如果您正苦于以下问题:PHP Pommo::_auth方法的具体用法?PHP Pommo::_auth怎么用?PHP Pommo::_auth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pommo
的用法示例。
在下文中一共展示了Pommo::_auth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public static function init($args = array())
{
$defaults = array('authLevel' => 1, 'keep' => FALSE, 'noSession' => FALSE, 'sessionID' => NULL, 'install' => FALSE);
// merge submitted parameters
$p = Pommo_Api::getParams($defaults, $args);
// Return if not config.php file present
if (!self::$_hasConfigFile) {
return false;
}
// Bypass Reading of Config, SESSION creation, and authentication checks
// and return if 'install' passed
if ($p['install']) {
return;
}
// load configuration data. Note: cannot save in session, as session
// needs unique key -- this is simplest method.
self::$_config = Pommo_Api::configGetBase();
// toggle DB debugging
if (self::$_debug) {
self::$_dbo->debug(TRUE);
}
// Bypass SESSION creation, reading of config, authentication checks
// and return if 'noSession' passed
if ($p['noSession']) {
return;
}
// Start the session
if (!empty($p['sessionID'])) {
session_id($p['sessionID']);
}
self::startSession();
// check for "session" language -- user defined language on the fly.
if (self::$_slanguage) {
self::$_session['slanguage'] = self::$_slanguage;
}
if (isset(self::$_session['slanguage'])) {
if (self::$_session['slanguage'] == 'en') {
self::$_l10n = FALSE;
} else {
self::$_l10n = TRUE;
require_once self::$_baseDir . 'classes/Pommo_Helper_L10n.php';
Pommo_Helper_L10n::init(self::$_session['slanguage'], self::$_baseDir);
}
self::$_slanguage = self::$_session['slanguage'];
}
// if authLevel == '*' || _poMMo_support (0 if poMMo not installed,
// 1 if installed)
if (defined('_poMMo_support')) {
require_once self::$_baseDir . 'classes/Pommo_Install.php';
$p['authLevel'] = Pommo_Install::verify() ? 1 : 0;
}
// check authentication levels
self::$_auth = new Pommo_Auth(array('requiredLevel' => $p['authLevel']));
// clear SESSION 'data' unless keep is passed.
// TODO --> phase this out in favor of page state system?
// -- add "persistent" flag & complicate state initilization...
if (!$p['keep']) {
self::$_session['data'] = array();
}
}