本文整理汇总了PHP中Vtiger_Functions::getUserRecordLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Functions::getUserRecordLabel方法的具体用法?PHP Vtiger_Functions::getUserRecordLabel怎么用?PHP Vtiger_Functions::getUserRecordLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Functions
的用法示例。
在下文中一共展示了Vtiger_Functions::getUserRecordLabel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
function process(Vtiger_Request $request)
{
$username = $request->get('username');
$password = $request->get('password');
if ($request->get('mode') == 'install') {
error_reporting(0);
$dirPath = 'install';
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dirPath, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST) as $path) {
$path->isDir() ? rmdir($path->getPathname()) : unlink($path->getPathname());
}
rmdir($dirPath);
}
$checkBlocked = Settings_BruteForce_Module_Model::checkBlocked();
$bruteForceSettings = Settings_BruteForce_Module_Model::getBruteForceSettings();
if ($checkBlocked && $bruteForceSettings['active']) {
Settings_BruteForce_Module_Model::sendNotificationEmail();
header('Location: index.php?module=Users&parent=Settings&view=Login&error=2');
exit;
}
$user = CRMEntity::getInstance('Users');
$user->column_fields['user_name'] = $username;
$moduleModel = Users_Module_Model::getInstance('Users');
if ($user->doLogin($password)) {
if (vglobal('session_regenerate_id')) {
session_regenerate_id(true);
}
// to overcome session id reuse.
$userid = $user->retrieve_user_id($username);
Vtiger_Session::set('AUTHUSERID', $userid);
// For Backward compatability
// TODO Remove when switch-to-old look is not needed
$_SESSION['authenticated_user_id'] = $userid;
$_SESSION['app_unique_key'] = vglobal('application_unique_key');
$_SESSION['authenticated_user_language'] = vglobal('default_language');
$_SESSION['user_name'] = $username;
$_SESSION['full_user_name'] = Vtiger_Functions::getUserRecordLabel($userid);
//Enabled session variable for KCFINDER
$_SESSION['KCFINDER'] = array();
$_SESSION['KCFINDER']['disabled'] = false;
$_SESSION['KCFINDER']['uploadURL'] = "cache/upload";
$_SESSION['KCFINDER']['uploadDir'] = "../../cache/upload";
$deniedExts = implode(" ", vglobal('upload_badext'));
$_SESSION['KCFINDER']['deniedExts'] = $deniedExts;
// End
//Track the login History
$moduleModel->saveLoginHistory($user->column_fields['user_name']);
//End
header('Location: index.php');
exit;
} else {
//Track the login History
$browser = Settings_BruteForce_Module_Model::browserDetect();
$moduleModel->saveLoginHistory($username, 'Failed login', $browser);
header('Location: index.php?module=Users&parent=Settings&view=Login&error=1');
exit;
}
}
示例2: getBreadcrumbs
public static function getBreadcrumbs($pageTitle = false)
{
$breadcrumbs = false;
$request = new Vtiger_Request($_REQUEST, $_REQUEST);
$userPrivModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
$roleMenu = 'user_privileges/menu_' . filter_var($userPrivModel->get('roleid'), FILTER_SANITIZE_NUMBER_INT) . '.php';
if (file_exists($roleMenu)) {
require $roleMenu;
} else {
require 'user_privileges/menu_0.php';
}
if (count($menus) == 0) {
require 'user_privileges/menu_0.php';
}
$moduleName = $request->getModule();
$view = $request->get('view');
$parent = $request->get('parent');
if ($parent !== 'Settings') {
if (empty($parent)) {
foreach ($parentList as &$parentItem) {
if ($moduleName == $parentItem['name']) {
$parent = $parentItem['parent'];
break;
}
}
}
$parentMenu = self::getParentMenu($parentList, $parent, $moduleName);
if (count($parentMenu) > 0) {
$breadcrumbs = array_reverse($parentMenu);
}
$breadcrumbs[] = ['name' => vtranslate($moduleName, $moduleName), 'url' => 'index.php?module=' . $moduleName . '&view=List'];
if ($pageTitle) {
$breadcrumbs[] = ['name' => vtranslate($pageTitle, $moduleName)];
} elseif ($view == 'Edit' && $request->get('record') == '') {
$breadcrumbs[] = ['name' => vtranslate('LBL_VIEW_CREATE', $moduleName)];
} elseif ($view != '' && $view != 'index' && $view != 'Index') {
$breadcrumbs[] = ['name' => vtranslate('LBL_VIEW_' . strtoupper($view), $moduleName)];
} elseif ($view == '') {
$breadcrumbs[] = ['name' => vtranslate('LBL_HOME', $moduleName)];
}
if ($request->get('record') != '') {
$recordLabel = Vtiger_Functions::getCRMRecordLabel($request->get('record'));
if ($recordLabel != '') {
$breadcrumbs[] = ['name' => $recordLabel];
}
}
} elseif ($parent === 'Settings') {
$qualifiedModuleName = $request->getModule(false);
$breadcrumbs[] = ['name' => vtranslate('LBL_VIEW_SETTINGS', $qualifiedModuleName), 'url' => 'index.php?module=Vtiger&parent=Settings&view=Index'];
if ($moduleName !== 'Vtiger' || $view !== 'Index') {
$fieldId = $request->get('fieldid');
$menu = Settings_Vtiger_MenuItem_Model::getAll();
foreach ($menu as &$menuModel) {
if (empty($fieldId)) {
if ($menuModel->getModule() == $moduleName) {
$parent = $menuModel->getMenu();
$breadcrumbs[] = ['name' => vtranslate($parent->get('label'), $qualifiedModuleName)];
$breadcrumbs[] = ['name' => vtranslate($menuModel->get('name'), $qualifiedModuleName), 'url' => $menuModel->getUrl()];
break;
}
} else {
if ($fieldId == $menuModel->getId()) {
$parent = $menuModel->getMenu();
$breadcrumbs[] = ['name' => vtranslate($parent->get('label'), $qualifiedModuleName)];
$breadcrumbs[] = ['name' => vtranslate($menuModel->get('name'), $qualifiedModuleName), 'url' => $menuModel->getUrl()];
break;
}
}
}
if ($pageTitle) {
$breadcrumbs[] = ['name' => vtranslate($pageTitle, $moduleName)];
} elseif ($view == 'Edit' && $request->get('record') == '' && $request->get('parent_roleid') == '') {
$breadcrumbs[] = ['name' => vtranslate('LBL_VIEW_CREATE', $qualifiedModuleName)];
} elseif ($view != '' && $view != 'List') {
$breadcrumbs[] = ['name' => vtranslate('LBL_VIEW_' . strtoupper($view), $qualifiedModuleName)];
}
if ($request->get('record') != '') {
$recordLabel = Vtiger_Functions::getUserRecordLabel($request->get('record'));
if ($recordLabel != '') {
$breadcrumbs[] = ['name' => $recordLabel];
}
}
}
}
return $breadcrumbs;
}
示例3: getUserFullName
function getUserFullName($userid)
{
return Vtiger_Functions::getUserRecordLabel($userid);
}
示例4: process
function process(Vtiger_Request $request)
{
$username = $request->get('username');
$password = $request->get('password');
if ($request->get('mode') == 'install') {
$dirPath = 'install';
Users_Module_Model::deleteLangFiles();
$configTemplate = "config/config.template.php";
if (file_exists($configTemplate)) {
unlink($configTemplate);
}
Vtiger_Functions::recurseDelete($dirPath);
}
$checkBlocked = Settings_BruteForce_Module_Model::checkBlocked();
$bruteForceSettings = Settings_BruteForce_Module_Model::getBruteForceSettings();
if ($checkBlocked && $bruteForceSettings['active']) {
Settings_BruteForce_Module_Model::sendNotificationEmail();
header('Location: index.php?module=Users&parent=Settings&view=Login&error=2');
exit;
}
$user = CRMEntity::getInstance('Users');
$user->column_fields['user_name'] = $username;
$moduleModel = Users_Module_Model::getInstance('Users');
if ($user->doLogin($password)) {
if (vglobal('session_regenerate_id')) {
Vtiger_Session::regenerateId(true);
}
// to overcome session id reuse.
$userid = $user->retrieve_user_id($username);
Vtiger_Session::set('AUTHUSERID', $userid);
// For Backward compatability
// TODO Remove when switch-to-old look is not needed
Vtiger_Session::set('authenticated_user_id', $userid);
Vtiger_Session::set('app_unique_key', vglobal('application_unique_key'));
Vtiger_Session::set('authenticated_user_language', vglobal('default_language'));
Vtiger_Session::set('user_name', $username);
Vtiger_Session::set('full_user_name', Vtiger_Functions::getUserRecordLabel($userid));
if ($request->has('language') && vglobal('langInLoginView')) {
Vtiger_Session::set('language', $request->get('language'));
}
if ($request->has('layout')) {
Vtiger_Session::set('layout', $request->get('layout'));
}
//Enabled session variable for KCFINDER
$_SESSION['KCFINDER'] = array();
$_SESSION['KCFINDER']['disabled'] = false;
$_SESSION['KCFINDER']['uploadURL'] = "cache/upload";
$_SESSION['KCFINDER']['uploadDir'] = "../../cache/upload";
$deniedExts = implode(" ", vglobal('upload_badext'));
$_SESSION['KCFINDER']['deniedExts'] = $deniedExts;
// End
//Track the login History
$moduleModel->saveLoginHistory($user->column_fields['user_name']);
//End
if (isset($_SESSION['return_params'])) {
$return_params = urldecode($_SESSION['return_params']);
header("Location: index.php?{$return_params}");
exit;
} else {
header('Location: index.php');
exit;
}
} else {
//Track the login History
$browser = Settings_BruteForce_Module_Model::browserDetect();
$moduleModel->saveLoginHistory($username, 'Failed login', $browser);
header('Location: index.php?module=Users&parent=Settings&view=Login&error=1');
exit;
}
}