本文整理汇总了PHP中Login类的典型用法代码示例。如果您正苦于以下问题:PHP Login类的具体用法?PHP Login怎么用?PHP Login使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Login类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: page_management_admin
function page_management_admin()
{
parent::Controller();
//Check login
$this->load->module('login');
// load 'DB_Interaction' model
$this->load->model('DB_Interaction');
$this->load->model('Page_DB_Interaction');
// load library
$this->load->library('Table');
/*-----------------------------------------------------------------------*/
//URL TO HELP FOR REDIRECT WHEN USER LOGS OUT
/*
| Basic REASON behind these is that Ajax Call should not be part of the REMEMBER URL in lOGIN function
*/
$this->session->unset_userdata('LastUrl');
$this->session->set_userdata('LastUrl', $this->page_name);
/*-----------------------------------------------------------------------*/
// load Helpers
$this->load->helper(array('date', 'text', 'useful'));
$l = new Login();
if ($l->_is_logged_in()) {
} else {
redirect('login');
}
//---------------------------CHECK MODULE ACESS--------------------------
if ($this->session->userdata('user') != '[email protected]') {
if (!$l->_module_access($this->parent_controller)) {
$this->session->set_flashdata('invalid_url_access', 'You do not Have Sufficient Priviledge to Access the Page !');
redirect('adminx');
}
}
}
开发者ID:gargiraut,项目名称:CI-modules,代码行数:33,代码来源:page_management_admin.php
示例2: btnSubmit_Click
public function btnSubmit_Click($strFormId, $strControlId, $strParameter)
{
// Create a login object with the information
$objLogin = new Login();
$objLogin->FirstName = $this->strFirstName->Text;
$objLogin->LastName = $this->strLastName->Text;
$objLogin->Username = $this->strUserName->Text;
$objLogin->RoleTypeId = RoleType::Volunteer;
if (strlen(trim($this->strEmail->Text)) > 0) {
$objLogin->Email = $this->strEmail->Text;
}
$objLogin->SetPasswordCache($this->strPassword->Text);
$objLogin->LoginActiveFlag = $this->lstActiveFlag->SelectedValue;
$objLogin->DomainActiveFlag = false;
$intBitmap = 0;
foreach ($this->rblPermissionArray as $rblPermission) {
$intBitmap = $intBitmap | $rblPermission->SelectedValue;
}
$objLogin->PermissionBitmap = $intBitmap;
$objLogin->Save();
// Update ministries associated
$objLogin->UnassociateAllMinistries();
foreach ($this->rblMinistryArray as $rblMinistry) {
$objMinistry = Ministry::LoadById($rblMinistry->SelectedValue);
if ($objMinistry) {
$objMinistry->AssociateLogin($objLogin);
}
}
QApplication::Redirect('/admin/externusers/');
}
开发者ID:alcf,项目名称:chms,代码行数:30,代码来源:add.php
示例3: checkLogin
/**
* Check login and create login page if requested otherwise say access deinied.
* param $login boolean, true - display login form if not logged in, otherwise display access denied message.
*/
public function checkLogin($login, $infoLoad = false)
{
//if not logged in
if (!$this->loggedIn()) {
//Show a login form if asked for
if ($login) {
//Create new page system
$p = new Page(null, false);
//Create login system
$l = new Login();
//Create a login form for this anonymous user
$l->createLogin($p, $this->getController()->getView(), true);
//NEVER GETS HERE LOGIN CLASS EXITS
//Display the page.
$p->displayPage();
//Quit the system
$this->getController()->freeze_all();
} else {
//Set the title of the page
$this->getController()->getView()->setContentTitle(file_get_contents("core/fragments/access_denied_title.phtml"));
//Set the content for access denied
$this->getController()->getView()->setContent(file_get_contents("core/fragments/access_denied_content.phtml"));
//Set to 2 columns
$this->getController()->getView()->setTwoColumn();
$this->getController()->getView()->setLeftTitle("");
$this->getController()->getView()->setLeftContent("");
//Display the page.
$this->getController()->getView()->displayPage();
//Quit the system
$this->getController()->freeze_all();
}
} else {
return true;
}
}
开发者ID:andreaspada,项目名称:LotusCMS-Content-Management-System,代码行数:39,代码来源:model.php
示例4: api
/**
* Function to process api request.
* @param string $data Base64 encoded json string with api request data.
*/
function api($data)
{
// decode json data from get
$data = base64_decode($data);
$data = json_decode($data);
// convert to login, logout or data request
$response = null;
$request = null;
if (Login::isInstance($data)) {
$request = new Login($data->data->warehouseId, $data->data->pw);
$response = $request->login();
} elseif (Logout::isInstance($data)) {
$request = new Logout($data->sessionId);
$response = $request->logout();
} elseif (DataRequest::isInstance($data)) {
if (isset($data->sessionId) && isset($data->data)) {
$request = new DataRequest($data->sessionId, $data->f, $data->data);
} elseif (isset($data->sessionId)) {
$request = new DataRequest($data->sessionId, $data->f);
} else {
if (isset($data->data)) {
$request = new DataRequest(0, $data->f, $data->data);
} else {
$request = new DataRequest(0, $data->f);
}
}
$response = $request->process();
}
return json_encode(array('request' => $request, 'response' => $response));
}
开发者ID:hanneseilers,项目名称:Social-Warehouse,代码行数:34,代码来源:api.php
示例5: insertOrUpdateProduct
public function insertOrUpdateProduct($post)
{
parent::createConnection();
$house_no = $post['house_no'];
$street_name = parent::getEscaped($post['street_name']);
$apartment_no = parent::getEscaped($post['apartment_no']);
$city = parent::getEscaped(ucwords($post['city']));
$state = $post['state'];
$country = $post['country'];
$zip = strtoupper($post['zip']);
$type = $post['range'];
$description = parent::getEscaped($post['description']);
$room_no = $post['rooms'];
$bath_no = $post['bathrooms'];
$living_room_no = $post['living_rooms'];
$price = parent::getEscaped($post['price']);
$rangeType = $post['rangeType'];
$loginObj = new Login();
$user_id = $loginObj->getUserId();
if (isset($post['upload']) && isset($_FILES['files'])) {
$query1 = "INSERT INTO address_info VALUES (DEFAULT, '{$house_no}', '{$street_name}', '{$apartment_no}', '{$city}', '{$state}', '{$zip}', '{$country}')";
parent::executeSqlQuery($query1);
$addressId = parent::getLastId();
$query = "INSERT INTO dwellings VALUES (DEFAULT, '{$addressId}', '{$user_id}', '{$type}', '{$description}', '{$room_no}', '{$bath_no}', '{$living_room_no}', '{$price}', '{$rangeType}')";
parent::executeSqlQuery($query);
$this->uploadImages($_FILES);
} elseif (isset($post['update'])) {
$dwelling_Id = $post['hiddenID'];
$address_id = $this->getAddressId($dwelling_Id);
$updateDwellings = "UPDATE dwellings SET type \t\t \t\t= '{$type}', \t\tdescription \t= '{$description}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t no_of_rooms \t\t= '{$room_no}', \t\tno_of_bathrooms\t= '{$bath_no}', \t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t no_of_living_rooms = '{$living_room_no}',price \t\t\t= '{$price}'\n\t\t\t\t\t\t\t\t\t\t\t\t WHERE dwelling_Id = {$dwelling_Id}";
$updateAddress = "UPDATE address_info SET house_no \t\t\t= '{$house_no}', \t\tstreet_name \t\t= '{$street_name}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t apartment_no \t\t= '{$apartment_no}', \tcity \t\t \t\t= '{$city}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t province \t\t\t= '{$state}', \t\tzip_code \t \t\t= '{$zip}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t country\t\t\t\t= '{$country}'\n\t\t\t\t\t\t\t\t\t\t\t WHERE address_id \t= '{$address_id}'";
parent::executeSqlQuery($updateDwellings);
parent::executeSqlQuery($updateAddress);
}
}
开发者ID:VergaraF,项目名称:estate-reel,代码行数:35,代码来源:productClass.php
示例6: logar
public function logar(Login $login)
{
$Sql = new Sql();
$sb = new StringBuilder();
$sb->append("SELECT *");
$sb->append("FROM " . T_USUARIO);
$sb->append(sprintf("WHERE login_usr = %s", $login->getLoginUsr()));
$sb->append(sprintf("AND senha_usr = %s", $login->getSenhaUsr()));
$sb->append("AND ativo_usr = 1");
$retorno = $Sql->ExecutaSQL($sb->toString());
if (count($retorno) > 0) {
global $Sess;
// Dados do Usuario Logado
$Sess->usuario = $retorno[0];
// Atualiza o usuário
$usuario = new Usuarios();
$usuario->setCodigoUsr(toNumero($retorno[0]['codigo_usr']));
$usuario->setUltimoacessoUsr(toDateTime());
$this->alterar($usuario);
// inicia Sessao
$Sess->logado_sys = true;
$Sess->ultimoacesso_sys = time();
return true;
}
return false;
}
开发者ID:jhonleandres,项目名称:estagio,代码行数:26,代码来源:LoginDAO.php
示例7: showAll
public function showAll()
{
session_start();
$login = new Login();
$id = $login->isLogged();
if ($id) {
$user = new User($id);
$regNumber = $user->regNumber;
$data["user"] = $user;
//echo $regNumber;
} else {
header('Location: http://localhost/WEB_Projeto_Final/public_html/home');
}
$show_questions = new Questao();
$results = $show_questions->getAll();
$getSubjects = $show_questions->getSubjects($regNumber);
//var_dump($getSubjects);
$data["subjects"] = array_unique($getSubjects);
$data['questions'] = $results;
$data['images'] = $show_questions->getImages($results);
$data['answers'] = $show_questions->getAnswer($results);
$this->view('questoes/listar', $data);
// echo $result[0]->value;
// var_dump($results);
}
开发者ID:Huijari,项目名称:WEB_Projeto_Final,代码行数:25,代码来源:listarController.class.php
示例8: r
public function r($params = null)
{
session_start();
$loginClass = new Login();
$loginClass->register($params[0], $params[1], $params[2], $params[3], $params[4], $params[5]);
$this->redirect('');
}
开发者ID:Huijari,项目名称:WEB_Projeto_Final,代码行数:7,代码来源:homeController.class.php
示例9: Render
public function Render($files, \Slim\Slim &$app, $comments)
{
//getting files
$this->files = $files;
$obj = new Files();
$obj->parseFile($files);
$obj->CheckFormat();
//$cookieDB = $obj->cookie;
$db = $app->db;
$public = $obj->public;
$filesize = new Filesize();
$user_id = $obj->user_id;
//getting id of the User from Files table
$getLog = new Login();
$login = $getLog->getLogin($user_id, $db);
$app->view->setData(array('login' => $login));
$cookie = $app->getCookie('username');
//getting cookie of the current user
$logged = new Logged();
$id = $logged->getLogged($db, $cookie);
//checking of the user is registered in Users table as the user or anonymous which added this file and getting his id
if ($id == $user_id) {
//if the id of Author of the file and the id of the user that opens this file are equal
$app->render('File.php', ['files' => $files, 'filesize' => $filesize, 'comments' => $comments, 'db' => $db]);
//we rendeer the form for the Author
} elseif ($public == 0) {
//else we render the form for the quest
$app->render('Public.php', ['files' => $files, 'filesize' => $filesize, 'comments' => $comments, 'db' => $db]);
} else {
$this->app->redirect('/TwigBlog/');
//if the file was private and the user isnt his author we render 404
}
}
开发者ID:toppestkek,项目名称:TwigBlog,代码行数:33,代码来源:Checkrights.php
示例10: check_login_status
function check_login_status()
{
$return_value = "";
// create a login object. when this object is created, it will do all login/logout stuff automatically
// so this single line handles the entire login process. in consequence, you can simply ...
$login = new Login();
// ... ask if we are logged in here:
if ($login->isUserLoggedIn() == true) {
// the user is logged in. you can do whatever you want here.
// for demonstration purposes, we simply show the "you are logged in" view.
//include("login/views/logged_in.php");
// do nothing.
$return_value = "login_good";
} else {
// the user is not logged in. you can do whatever you want here.
// for demonstration purposes, we simply show the "you are not logged in" view.
//include("login/views/not_logged_in.php");
//print "login_required" ;
$return_value = "Login not good";
if (isset($login)) {
if ($login->errors) {
foreach ($login->errors as $error) {
$return_value .= $error;
}
}
if ($login->messages) {
foreach ($login->messages as $message) {
$return_value .= $message;
}
}
}
}
return $return_value;
}
开发者ID:krisjanis-gross,项目名称:remote-pi,代码行数:34,代码来源:login_handler.php
示例11: executeIndex
/**
*
* Load Userrights and User Id to Sesseion.
*
* @param sfRequest $request A request object
*/
public function executeIndex(sfWebRequest $request) {
$loginObject = new Login();
/*
* Load the userrole, userrigths, userSettings, userId, workflowSettings for the logged user and store to session
*/
$userSettings = UserSettingTable::instance()->getUserSettingById($this->getUser()->getAttribute('id'));
$userWorkflowSetting = UserWorkflowConfigurationTable::instance()->getSingleUserWorkflowConfigurattion($this->getUser()->getAttribute('id'))->toArray();
$this->getUser()->setAttribute('userSettings', $userSettings[0]->toArray()); // set userSettings
$config = SystemConfigurationTable::instance()->getSystemConfiguration()->toArray();
$this->getUser()->setAttribute('userWorkflowSettings', $loginObject->generateUserWorklowView($userWorkflowSetting, sfContext::getInstance())); // set workflowsettings
$data = $this->getUser()->getAttribute('userWorkflowSettings');
$credentials = CredentialTable::instance()->getAllCredentials();
$userrights = CredentialRoleTable::instance()->getCredentialRoleById($this->getUser()->getAttribute('id'));
$rights = $loginObject->loadUserRight($credentials, $userrights);
$this->getUser()->setAttribute('credential', $rights); // set rights and role
$this->systemConfiguration = $config[0];
$this->theTheme = $userSettings[0]->getTheme(); // load the users theme
/*
* -1 is set when user uses login form to login
* int is set, when user logges in from en email link, then a workflow needs to opened
*/
$this->version_id = $request->getParameter('versionid',-1);
$this->workflow_id = $request->getParameter('workflow',-1);
$this->window = $request->getParameter('window',-1);
return sfView::SUCCESS;
}
开发者ID:rlauenroth,项目名称:cuteflow_v3,代码行数:33,代码来源:actions.class.php
示例12: actionIndex
public function actionIndex()
{
$loginModel = new Login();
$data['loginModel'] = $loginModel;
$data['loginerror'] = 0;
//前台登陆
if (isset($_POST['Login'])) {
$loginModel->attributes = $_POST['Login'];
if (!$loginModel->validate()) {
$data['loginerror'] = 1;
} else {
$sql = "select id from {{user}} where username = '" . $_POST['Login']['loginname'] . "' and password = '" . md5($_POST['Login']['loginpass']) . "' ";
$LoginInfo = $loginModel->findBySql($sql);
if ($LoginInfo == NULL) {
$loginModel->addError("loginname", "用户名或密码错误!");
$data['loginerror'] = 1;
} else {
Yii::app()->session['uid'] = $LoginInfo['id'];
$this->redirect(array("/index/m", 'who' => $LoginInfo['id']));
}
}
}
$userModel = User::model();
$url = "http://" . Yii::app()->params['bucket'] . "." . Yii::app()->params['domain'] . "/";
$sql = "select id,username,headpicture from {{user}}";
$data['users'] = $userModel->findAllBySql($sql);
$data['url'] = $url;
//切换布局
$this->layout = "//layouts/register";
$this->render("imain", $data);
}
开发者ID:biggtfish,项目名称:A-Simple-CMS,代码行数:31,代码来源:IndexController.php
示例13: Login
function Login($username, $password)
{
$login = new Login();
$login->SetUsername($username);
$login->SetPassword($password);
$result = $login->DoLogin();
return new soapval("return", "xsd:boolean", $result);
}
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:8,代码来源:login.service.class.php
示例14: IsLoginCanViewMinistry
/**
* In short, does this login have privileges to view this ministry?
* To cater for volunteers, who we want to restrict to just viewing the ministries
* in which they're assisting
*
* @param Login $objLogin
* @return boolean
*/
public function IsLoginCanViewMinistry(Login $objLogin)
{
if ($objLogin->RoleTypeId == RoleType::Volunteer) {
return $objLogin->IsMinistryAssociated($this);
} else {
return true;
}
}
开发者ID:alcf,项目名称:chms,代码行数:16,代码来源:Ministry.class.php
示例15: salir
public function salir()
{
if (isset($_SESSION["Usuario"])) {
session_destroy();
}
$Login = new Login();
$Login->index();
}
开发者ID:pspaulus,项目名称:MyBici_server,代码行数:8,代码来源:Escritorio.php
示例16: Login
/**
* 登录
* @param unknown $param
*/
public function Login($param)
{
import('SC.User.Login');
//导入相应的类库
$userLogin = new Login($param);
$result = $userLogin->run();
echo $result;
}
开发者ID:iOSDevelopment2016,项目名称:SuperCourseServer,代码行数:12,代码来源:Api.class.php
示例17: login
public function login()
{
$user = new Login();
if ($user->valid()) {
return 'home.tpl';
} else {
return 'login.tpl';
}
}
开发者ID:Maharaja1,项目名称:drdata,代码行数:9,代码来源:smi-controller.php
示例18: check_username
/**
* Check username
*/
public function check_username()
{
$this->load->model('user');
$user = new Login();
if ($user->check_username() == true) {
// Username does not exist
} else {
echo 'Username already has been taken';
}
}
开发者ID:suman0359,项目名称:RCO-RoyNabel,代码行数:13,代码来源:login.php
示例19: executeNew
public function executeNew(sfWebRequest $request)
{
$isModerator = $request->getParameter('type') == 'animator' ? true : false;
$this->isModerator = $isModerator;
$moderator = new Moderator();
$login = new Login();
$login->setIsModerator($isModerator);
$moderator->setLogin($login);
$this->form = new ModeratorForm($moderator, array('new' => true));
}
开发者ID:xmasclaux,项目名称:OpenGenepi,代码行数:10,代码来源:actions.class.php
示例20: login
private static function login()
{
$client = new Login(addslashes($_POST['login']), addslashes($_POST['password']));
$login = $client->identification();
if ($login) {
$_SESSION['login'] = $client->getIdentifiant();
return true;
}
return false;
}
开发者ID:bosoy83,项目名称:keywords-analyzer,代码行数:10,代码来源:class.security.php
注:本文中的Login类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论