本文整理汇总了PHP中Singleton::UserMgr方法的典型用法代码示例。如果您正苦于以下问题:PHP Singleton::UserMgr方法的具体用法?PHP Singleton::UserMgr怎么用?PHP Singleton::UserMgr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Singleton
的用法示例。
在下文中一共展示了Singleton::UserMgr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: User
$field->type = $element['yg_type'] ? $element['yg_type'] : null;
$field->property = $element['yg_property'] ? $element['yg_property'] : null;
$field->yg_id = $element['yg_id'] ? $element['yg_id'] : null;
$fields[$field->property] = $field;
$field = null;
}
$this->fields = $fields;
$data[1] = $data[1][0];
}
// Load code specific to ajaxaction mapped in configfile
$this->rawdata = $data[1];
$this->elements = $elements;
$this->handler = $this->request->parameters['handler'];
$action = $this->handler;
// Check if user is authenticated and allowed to access the backend
$tmpUser = new User(Singleton::UserMgr()->getCurrentUserID());
$backendAllowed = $tmpUser->checkPermission('RBACKEND');
if ((!$this->authenticated || !$backendAllowed) && ($action != 'userLogin' && $action != 'recoverLogin' && $action != 'setNewPassword')) {
$header = $_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden';
header($header);
echo $header;
die;
}
$this->code = sConfig()->getVar('CONFIG/AJAXACTIONS/' . strtoupper($this->handler) . '/CODE');
$this->event = $data[0];
$indexname = $this->rawdata['yg_property'] ? $this->rawdata['yg_property'] : null;
$this->responsedata = array();
$this->reponsedata[$indexname]->id = $this->rawdata['id'];
if ($this->rawdata['name']) {
$this->reponsedata[$indexname]->name = $this->rawdata['name'];
}
示例2: go
public function go()
{
header("Content-Type: text/html; charset=UTF-8");
// Import Libraries
\framework\import("org.yeager.framework.tools.password");
\framework\import("org.yeager.ui.common");
\framework\import("org.yeager.ui.koala");
\framework\import("org.yeager.ui.icons");
\framework\import("org.yeager.framework.tools.password");
\framework\import("org.yeager.framework.tools.http.redirect");
\framework\import("org.yeager.framework.tools.http.byteserve");
\framework\import("org.yeager.core.versionable");
\framework\import("org.yeager.core.tree");
\framework\import("org.yeager.core.permissions");
\framework\import("org.yeager.core.privileges");
\framework\import("org.yeager.core.propertysettings");
\framework\import("org.yeager.core.properties");
\framework\import("org.yeager.core.history");
\framework\import("org.yeager.core.jsqueue");
\framework\import("org.yeager.core.tags");
\framework\import("org.yeager.core.comments");
\framework\import("org.yeager.core.cblock");
\framework\import("org.yeager.core.cblockmgr");
\framework\import("org.yeager.core.entrymasks");
\framework\import("org.yeager.core.page");
\framework\import("org.yeager.core.pagemgr");
\framework\import("org.yeager.core.file");
\framework\import("org.yeager.core.filemgr");
\framework\import("org.yeager.core.filetypes");
\framework\import("org.yeager.core.views");
\framework\import("org.yeager.core.mailing");
\framework\import("org.yeager.core.mailingmgr");
\framework\import("org.yeager.core.templates");
\framework\import("org.yeager.core.usergroups");
\framework\import("org.yeager.core.sites");
\framework\import("org.yeager.core.languages");
\framework\import("org.yeager.core.reftracker");
\framework\import("org.yeager.core.scheduler");
\framework\import("org.yeager.core.extensionmgr");
\framework\import("org.yeager.core.extensions");
\framework\import("org.yeager.core.fileprocessor");
\framework\import("org.yeager.core.cblockprocessor");
\framework\import("org.yeager.core.emailprocessor");
\framework\import("org.yeager.core.pageprocessor");
\framework\import("org.yeager.core.user");
\framework\import("org.yeager.core.usermgr");
\framework\import("org.yeager.core.tree");
\framework\import('org.yeager.core.updater');
\framework\import('org.yeager.core.archive');
// Set UTF8 for DB
Singleton::YDB()->Execute("SET NAMES 'utf8';");
// Set ADODB-Fetchmode to ADODB_FETCH_ASSOC
Singleton::YDB()->SetFetchMode(ADODB_FETCH_ASSOC);
// Create instance of Koala class
$koala = new Koala($this->yeager);
$username = $this->session->getSessionVar("username");
$password = $this->session->getSessionVar("password");
Singleton::register("session", $this->session);
Singleton::register("request", $this->request);
Singleton::register("config", $this->config);
Singleton::register("UserMgr", new UserMgr());
Singleton::register("guiUS", $this->request->parameters['us']);
Singleton::register("guiLH", $this->request->parameters['lh']);
// Get frontend timezone
$this->frontendTimezone = (string) Singleton::config()->getVar('CONFIG/TIMEZONES/FRONTEND');
if (!$this->frontendTimezone) {
$this->frontendTimezone = 'Europe/Berlin';
}
$userID = Singleton::UserMgr()->validate($username, $password);
Singleton::register("Usergroups", new Usergroups());
if (!$userID) {
$userID = Singleton::UserMgr()->getAnonymousID();
$this->authenticated = false;
} else {
$this->authenticated = true;
if ($userID != Singleton::UserMgr()->getAnonymousID()) {
$this->session->setPSessionVar("username", $username);
$this->session->setPSessionVar("password", $password);
$this->session->setPSessionVar("userid", $userID);
$this->session->setPSessionVar("isvalidated", true);
}
if ($this->session->getSessionVar('keepLoggedIn')) {
$this->session->cookie_time = time() + 60 * 60 * 24 * 365;
} else {
$cookie_time = (int) Singleton::config()->getVar("CONFIG/SESSION/COOKIES/TIME");
$this->session->cookie_time = $cookie_time;
}
}
// write roles to sessions for cachekey
$user = new User($userID);
$roles = $user->getUsergroupIDs();
if ($userID != Singleton::UserMgr()->getAnonymousID()) {
$this->session->setPSessionVar("userroles", $roles);
$this->session->setPSessionVar("userid", $userID);
$this->session->setCookie("yg-userid", $userID);
$roleHash = "";
foreach ($roles as $r) {
$roleHash .= $r["ID"] . "x";
}
$this->session->setCookie("yg-userroles", $roleHash);
//.........这里部分代码省略.........
示例3: sUserMgr
/**
* Gets an instance of the UserMgr
* @return object UserMgr object
*/
function sUserMgr()
{
return Singleton::UserMgr();
}