本文整理汇总了PHP中Auth::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth::__construct方法的具体用法?PHP Auth::__construct怎么用?PHP Auth::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Auth
的用法示例。
在下文中一共展示了Auth::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($path = '')
{
parent::__construct($path);
if ($path[1] == 'ajax') {
//任意控制器的动作为ajax时, 执行ajax动作, 禁止输出页头, 页尾及数据库访问错误
APP::$DB->printerror = false;
//ajax数据库访问不打印错误信息
$this->ajax['s'] = 1;
//初始化ajax返回数据, s表示状态
$this->ajax['i'] = '';
//i指ajax提示信息
$this->ajax['d'] = '';
//d指ajax返回的数据
$this->json = new JSON();
if (!$this->admin) {
//管理员验证不成功, 直接输出ajax信息, 并终止ajax其它程序程序运行
$this->ajax['i'] = "管理员授权错误! 请确认已成功登录后台.";
die($this->json->encode($this->ajax));
}
} else {
if ($path[1] == 'logout') {
$this->logout();
}
//无论哪个控制器, 只要是logout动作, admin用户退出
if ($path[0] == 'online') {
$this->s_page_header($path);
//授权成功, 客服输出页头
} else {
$this->page_header($path);
//授权成功, 管理员输出页头
}
}
}
示例2: __construct
/**
* Constructor loads the user list into the class.
*/
public function __construct($config = array())
{
parent::__construct($config);
// Load user list
$this->_users = Arr::get($config, 'users', array());
}
示例3: __construct
public function __construct($options = array())
{
parent::__construct($options);
if (empty(self::$_specialities)) {
$m = $this->mongod();
self::$_specialities = $m->get('specialities');
}
}
示例4: __construct
public function __construct($config = array())
{
parent::__construct($config);
foreach ($config['services'] as $service => $config) {
$class = 'Auth_Service_' . Jam::capitalize_class_name($service);
$this->_services[$service] = new $class($config);
}
}
示例5: __construct
/**
* Constructor
*
* @param object Auth_ContainerBase
* @param array further options Not used in the moment
*/
public function __construct($container, $a_options = array())
{
$_POST['username'] = 'dummy';
$_POST['password'] = 'dummy';
parent::__construct($container, $a_options, '', false);
$this->setSessionName("_authhttp" . md5(CLIENT_ID));
$this->initAuth();
}
示例6: __construct
/**
* Constructor
*
* @param object $container
* @param array further options Not used in the moment
*/
public function __construct($a_container, $a_further_options = array())
{
global $PHPCAS_CLIENT;
parent::__construct($a_container, $a_further_options, array($a_container, 'forceAuthentication'), true);
$this->setSessionName("_authhttp" . md5(CLIENT_ID));
$this->initAuth();
if (is_object($PHPCAS_CLIENT) and $PHPCAS_CLIENT->isAuthenticated()) {
$this->username = $PHPCAS_CLIENT->getUser();
}
}
示例7: __construct
public function __construct($opts = [])
{
parent::__construct($opts);
$start = RequestMethods::get('start', date('Y-m-d', strtotime("-1 day")));
$end = RequestMethods::get('end', date('Y-m-d'));
$user_id = RequestMethods::get("user_id", null);
$this->start = $start;
$this->end = $end;
$this->user_id = $user_id;
}
示例8: __construct
/**
* Contructor
* @return
* @param object $a_container
* @param object $a_addition_options[optional]
*/
public function __construct($a_container, $a_addition_options = array())
{
parent::__construct($a_container, $a_addition_options, array($this, 'callProvider'), true);
$this->setSessionName("_authhttp" . md5(CLIENT_ID));
$this->initAuth();
$this->initSettings();
if (isset($_GET['oid_check_status'])) {
$_POST['username'] = 'dummy';
$_POST['password'] = 'dummy';
}
}
示例9: __construct
public function __construct($userman, $freepbx)
{
parent::__construct($userman, $freepbx);
$this->FreePBX = $freepbx;
$config = $userman->getConfig("authMSADSettings");
$this->host = $config['host'];
$this->port = !empty($config['port']) ? $config['port'] : 389;
$this->dn = $config['dn'];
$this->domain = $config['domain'];
$this->user = $config['username'];
$this->password = $config['password'];
$this->linkAttr = isset($config['la']) ? $config['la'] : '';
}
示例10: define
function __construct()
{
parent::__construct();
define('AMQP_DEBUG', false);
//define('MQ_HOST', '115.29.188.246');
// define('MQ_PORT', 5672);
// define('MQ_USER', 'valsun_tran');
// define('MQ_PASS', 'tranabc');
// define('MQ_VHOST', 'valsun_tran');
define('MQ_HOST', '192.168.200.198');
define('MQ_PORT', 5672);
define('MQ_USER', 'xiaojinhua');
define('MQ_PASS', 'jinhua');
define('MQ_VHOST', 'mq_vhost1');
}
示例11: __construct
/**
* Constructor
*
* @param string $username The username for authentication
* @param string $password The password
* @param boolean $autologin If the authentication is by autologin
* @param string $token The token string
*/
public function __construct($username, $password, $autologin, $token = "")
{
$config = \Centreon\Internal\Di::getDefault()->get('config');
if (1 === $config->get('default', 'sso_enable', 0)) {
if ('' !== $config->get('default', 'sso_header_username', '')) {
$this->sso_username = $_SERVER[$config->get('default', 'sso_header_username', '')];
$this->enable = true;
if ($this->checkSsoClient()) {
$self->sso_mandatory = 1;
$username = $this->sso_username;
}
}
}
parent::__construct($username, $password, $autologin, $token);
}
示例12: __construct
/**
* This constructor initializes the class using the specified config information.
*
* @access public
* @param mixed $config the config information to be used
* @throws Throwable_Exception indicates that error occurred when loading
* a configuration
*/
public function __construct($config = NULL)
{
parent::__construct($config);
if (isset($config['models'])) {
if (isset($config['models']['role'])) {
$this->models['role'] = $config['models']['role'];
}
if (isset($config['models']['user'])) {
$this->models['user'] = $config['models']['user'];
}
if (isset($config['models']['token'])) {
$this->models['token'] = $config['models']['token'];
}
}
if (isset($config['columns'])) {
if (isset($config['columns']['role_id'])) {
$this->columns['role_id'] = $config['columns']['role_id'];
}
if (isset($config['columns']['role_name'])) {
$this->columns['role_name'] = $config['columns']['role_name'];
}
if (isset($config['columns']['token'])) {
$this->columns['token'] = $config['columns']['token'];
}
if (isset($config['columns']['user_id'])) {
$this->columns['user_id'] = $config['columns']['user_id'];
}
if (isset($config['columns']['user_username'])) {
$this->columns['user_username'] = $config['columns']['user_username'];
}
if (isset($config['columns']['user_email'])) {
$this->columns['user_email'] = $config['columns']['user_email'];
}
}
if (empty($config['login_with_email']) and empty($config['login_with_username'])) {
throw new Throwable_Exception('Message: Unable to load configuration. Reason: A valid "login_with" setting must be set in you auth config file.');
}
}
示例13: __construct
public function __construct($container, $a_options = array())
{
parent::__construct($container, $a_options, '', false);
$this->setSessionName("_authhttp" . md5(CLIENT_ID));
$this->initAuth();
/*
parent::__construct($container);
if(isset($a_further_options['username']))
{
$_POST['username'] = $a_further_options['username'];
}
if(isset($a_further_options['password']))
{
$_POST['password'] = $a_further_options['password'];
}
$this->appendOption('sessionName',"_authhttp".md5(CLIENT_ID));
$this->appendOption('sessionSharing',false);
$this->initAuth();
$this->initCallbacks();
*/
}
示例14: __construct
/**
* Contructor
* @return
* @param object $a_container
* @param object $a_addition_options[optional]
*/
public function __construct($a_container, $a_addition_options = array())
{
global $lng;
parent::__construct($a_container, $a_addition_options, '', false);
$this->setSessionName("_authhttp" . md5(CLIENT_ID));
$this->apache_settings = new ilSetting('apache_auth');
if (defined('IL_CERT_SSO') && IL_CERT_SSO) {
// DO NOT DELETE!!!
// faking post values is REQUIRED to avoid canceling of the
// startup routines
// $_POST['username'] = 'xxx';
$_POST['password'] = 'yyy';
$_POST['sendLogin'] = '1';
$_POST['auth_mode'] = AUTH_APACHE;
$_POST['cmd[butSubmit]'] = 'Submit';
if ($_POST['username'] != 'anonymous') {
switch ($this->apache_settings->get('apache_auth_username_config_type')) {
case APACHE_AUTH_TYPE_DIRECT_MAPPING:
$_POST['username'] = $_SERVER[$this->apache_settings->get('apache_auth_username_direct_mapping_fieldname')];
break;
case APACHE_AUTH_TYPE_EXTENDED_MAPPING:
throw new ilException("APACHE_AUTH_TYPE_EXTENDED_MAPPING not yet implemented");
case APACHE_AUTH_TYPE_BY_FUNCTION:
include_once 'Services/AuthApache/classes/custom_username_func.php';
$_POST['username'] = ApacheCustom::getUsername();
break;
}
}
}
if (defined('IL_CERT_SSO') && IL_CERT_SSO && !$_POST['username']) {
$_POST['username'] = '§invalid';
$_POST['password'] = 'anonymous';
$_SESSION['username_invalid'] = true;
}
$this->initAuth();
}
示例15: DbExternalTokenAuth
function __construct($dbInfo)
{
parent::__construct();
$this->db = new DbExternalTokenAuth($dbInfo);
}