[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
1 <?php 2 /*+********************************************************************************** 3 * The contents of this file are subject to the vtiger CRM Public License Version 1.1 4 * ("License"); You may not use this file except in compliance with the License 5 * The Original Code is: vtiger CRM Open Source 6 * The Initial Developer of the Original Code is vtiger. 7 * Portions created by vtiger are Copyright (C) vtiger. 8 * All Rights Reserved. 9 ************************************************************************************/ 10 11 class Users_Login_Action extends Vtiger_Action_Controller { 12 13 function loginRequired() { 14 return false; 15 } 16 17 18 function checkPermission(Vtiger_Request $request) { 19 return true; 20 } 21 22 function process(Vtiger_Request $request) { 23 $username = $request->get('username'); 24 $password = $request->get('password'); 25 26 $user = CRMEntity::getInstance('Users'); 27 $user->column_fields['user_name'] = $username; 28 29 if ($user->doLogin($password)) { 30 $userid = $user->retrieve_user_id($username); 31 Vtiger_Session::set('AUTHUSERID', $userid); 32 33 // For Backward compatability 34 // TODO Remove when switch-to-old look is not needed 35 $_SESSION['authenticated_user_id'] = $userid; 36 $_SESSION['app_unique_key'] = vglobal('application_unique_key'); 37 $_SESSION['authenticated_user_language'] = vglobal('default_language'); 38 39 //Enabled session variable for KCFINDER 40 $_SESSION['KCFINDER'] = array(); 41 $_SESSION['KCFINDER']['disabled'] = false; 42 $_SESSION['KCFINDER']['uploadURL'] = "test/upload"; 43 $_SESSION['KCFINDER']['uploadDir'] = "../test/upload"; 44 $deniedExts = implode(" ", vglobal('upload_badext')); 45 $_SESSION['KCFINDER']['deniedExts'] = $deniedExts; 46 // End 47 48 //Track the login History 49 $moduleModel = Users_Module_Model::getInstance('Users'); 50 $moduleModel->saveLoginHistory($user->column_fields['user_name']); 51 //End 52 53 header ('Location: index.php?module=Users&parent=Settings&view=SystemSetup'); 54 exit(); 55 } else { 56 header ('Location: index.php?module=Users&parent=Settings&view=Login&error=1'); 57 exit; 58 } 59 } 60 61 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:08:37 2014 | Cross-referenced by PHPXref 0.7.1 |