本文整理汇总了PHP中user_login函数的典型用法代码示例。如果您正苦于以下问题:PHP user_login函数的具体用法?PHP user_login怎么用?PHP user_login使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_login函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
//validate login
if (user_login())
{
if($this->session->userdata('user_type') != 'reseller')
{
redirect ('home/');
}
else
{
$data['page_name'] = 'dashboard';
$data['selected'] = 'dashboard';
$data['page_title'] = 'DASHBOARD';
$data['main_menu'] = 'default/main_menu/reseller_main_menu';
$data['sub_menu'] = '';
$data['main_content'] = 'reseller/dashboard';
$this->load->view('default/template',$data);
}
}
else
{
redirect ('home/'); //main home controller
}
}
示例2: __construct
function __construct()
{
parent::__construct();
$this->load->model('freeswitch_model');
// validate login
if (!user_login())
{
redirect ('home/');
}
// else
// {
// if($this->session->userdata('user_type') == 'customer')
// {
// redirect ('customer/');
// }
//
// if($this->session->userdata('user_type') == 'reseller')
// {
// redirect ('reseller/');
// }
//
// if($this->session->userdata('user_type') == 'sub_admin')
// {
// if(sub_admin_access_any_cell($this->session->userdata('user_id'), 'view_profiles') == 0)
// {
// redirect ('home/');
// }
// }
// }
}
示例3: __construct
function __construct()
{
parent::__construct();
$this->load->model('groups_model');
$this->load->model('carriers_model');
//validate login
if (!user_login())
{
redirect ('home/');
}
else
{
if($this->session->userdata('user_type') == 'customer')
{
redirect ('customer/');
}
if($this->session->userdata('user_type') == 'reseller')
{
redirect ('reseller/');
}
if($this->session->userdata('user_type') == 'sub_admin')
{
if(sub_admin_access_any_cell($this->session->userdata('user_id'), 'view_rate_groups') == 0)
{
redirect ('home/');
}
}
}
}
示例4: __construct
function __construct()
{
parent::__construct();
$this->load->model('manage_accounts_model');
//validate login
if (!user_login())
{
redirect ('home/');
}
else
{
if($this->session->userdata('user_type') == 'customer')
{
redirect ('customer/');
}
if($this->session->userdata('user_type') == 'reseller')
{
redirect ('reseller/');
}
if($this->session->userdata('user_type') == 'sub_admin')
{
redirect ('home/');
}
}
}
示例5: ajax_login
public function ajax_login()
{
$return = false;
if (user_login()) {
$return = '<span>您好,' . $_SESSION['user_login']['uname'] . '</span><b>|</b><a href="' . U('user/logout') . '">登出</a>';
}
echo $return;
}
示例6: access
protected function access()
{
// 获取当前用户ID
if (user_login() <= 0) {
// 还没登录 跳转到登录页面
$this->redirect('user/login', '', '1', '请登录...');
}
}
示例7: authenticate
/**
* Authenticate user
*
* @static
* @param _array $user
* @param array $user['login']
* @param array $user['password']
* @return string session ID
*/
public static function authenticate($user)
{
$login = user_login($user['user'], $user['password'], ZBX_AUTH_INTERNAL);
if ($login) {
return $login;
} else {
self::$error = array('error' => ZBX_API_ERROR_PARAMETERS, 'data' => 'Given login or password is incorrect.');
}
}
示例8: smarty_validate_criteria_isValidPassword
/**
* test if a value is a valid range
*
* @param string $value the value being tested
* @param boolean $empty if field can be empty
* @param array params validate parameter values
* @param array formvars form var values
*/
function smarty_validate_criteria_isValidPassword($value, $empty, &$params, &$formvars)
{
if (!isset($params['field2'])) {
trigger_error("SmartyValidate: [isValidPassword] parameter 'field2' is missing.");
return false;
}
if (strlen($value) == 0) {
return $empty;
}
return user_login($formvars[$params['field']], $formvars[$params['field2']]);
}
示例9: Grader
function Grader()
{
parent::Controller();
$this->load->model('home_model');
$this->load->model('user_model');
$this->load->model('admin_model');
$this->load->helper('check_login');
$this->load->helper('breadcrumb');
if (!user_login()) {
redirect('main/home/user_login');
}
}
示例10: _initialize
public function _initialize()
{
parent::_initialize();
$this->_mod = D('user');
$this->_userid = user_login();
if ($this->_userid) {
$userinfo = $this->_mod->find($this->_userid);
$this->assign('userid', $this->_userid);
$this->assign('userinfo', $userinfo);
}
$this->assign('current', 'user');
$seo['title'] = '会员中心';
$this->_seo($seo);
}
示例11: Login
function Login()
{
$smarty = smarty_init(dirname(__FILE__) . '/templates');
if (isset($_REQUEST['submit'])) {
$data = formdata_from_post();
$errors = formdata_validate($data);
if (count($errors) == 0) {
user_login($data['Extension']);
header('Location: Account_Modify.php');
die;
}
}
$smarty->assign('Errors', $errors);
return $smarty->fetch('Login.tpl');
}
示例12: __construct
function __construct()
{
parent::__construct();
$this->load->model('reseller/billing_model');
$this->load->library('pdf');
//validate login
if (!user_login())
{
redirect ('home/');
}
else
{
if($this->session->userdata('user_type') != 'reseller')
{
redirect ('home/');
}
}
}
示例13: __construct
function __construct()
{
parent::__construct();
$this->load->model('reseller/groups_model');
$this->load->model('reseller/carriers_model');
//validate login
if (!user_login())
{
redirect ('home/');
}
else
{
if($this->session->userdata('user_type') != 'reseller')
{
redirect ('home/');
}
}
}
示例14: __construct
function __construct()
{
parent::__construct();
$this->load->model('customer_model');
$this->load->model('groups_model');
$this->load->model('manage_accounts_model');
$this->load->model('billing_model');
//validate login
if (!user_login())
{
redirect ('home/');
}
else
{
if($this->session->userdata('user_type') != 'customer')
{
redirect ('home/');
}
}
}
示例15: login_validate
function login_validate()
{
global $smarty, $lang;
$user = trim(@$_POST['user']);
$pass = trim(@$_POST['pass']);
$error = array();
$lerr =& $lang['login']['error'];
if (!$user) {
$error['user'] = $lerr['user'];
}
if (!$pass) {
$error['pass'] = $lerr['pass'];
}
if (!$error && !user_login($user, $pass)) {
$error['match'] = $lerr['match'];
}
if ($error) {
$smarty->assign('error', $error);
return 0;
}
return 1;
}