本文整理汇总了PHP中Acl::is_user方法的典型用法代码示例。如果您正苦于以下问题:PHP Acl::is_user方法的具体用法?PHP Acl::is_user怎么用?PHP Acl::is_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acl
的用法示例。
在下文中一共展示了Acl::is_user方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: menu
public static function menu()
{
if (!Acl::is_user() || !Base_AclCommon::check_permission('Fax - Browse')) {
return array();
}
return array(_M('CRM') => array('__submenu__' => 1, _M('Fax') => array()));
}
示例2: user_settings
public static function user_settings()
{
if (Acl::is_user()) {
return array(__('Calendar') => array(array('name' => 'first_day_of_week', 'label' => __('First day of week'), 'type' => 'select', 'values' => array(0 => __('Sunday'), 1 => __('Monday'), 2 => __('Tuesday'), 3 => __('Wednesday'), 4 => __('Thursday'), 5 => __('Friday'), 6 => __('Saturday')), 'default' => 0)));
}
return array();
}
示例3: user_settings
public static function user_settings()
{
if (Acl::is_user()) {
$methods = array('none' => __('None'), 'callto' => __('Skype and other "callto" protocol applications')) + ModuleManager::call_common_methods('dialer_description');
return array(__('Dialing') => array(array('name' => 'method', 'label' => __('Dialing Method'), 'type' => 'select', 'values' => $methods, 'default' => 'none')), __('Misc') => array(array('name' => 'default_record_permission', 'label' => __('Default Records Permission'), 'type' => 'select', 'default' => 0, 'values' => Utils_CommonDataCommon::get_translated_array('CRM/Access', false))));
}
return array();
}
示例4: user_settings
public static function user_settings()
{
if (Acl::is_user()) {
$info = '%D - ' . __('Date') . '<br>%T - ' . __('Time') . '<br>%U - ' . __('User');
$help = ' <img src="' . Base_ThemeCommon::get_icon('info') . '" ' . Utils_TooltipCommon::open_tag_attrs($info, false) . '/>';
return array(__('Notes') => array(array('name' => 'editor', 'label' => __('Editor'), 'type' => 'select', 'default' => 0, 'values' => array(__('Simple'), __('Advanced'))), array('name' => 'edited_on_format', 'label' => __('Edited on format') . $help, 'type' => 'text', 'default' => '%D<br><br>%T<br><br>%U')));
}
return array();
}
示例5: init
public static function init()
{
if ((!isset($_SESSION['base_login_audit']) || !isset($_SESSION['base_login_audit_user']) || $_SESSION['base_login_audit_user'] != Acl::get_user()) && Acl::is_user()) {
$now = time();
$remote_address = get_client_ip_address();
$remote_host = gethostbyaddr($remote_address);
DB::Execute('INSERT INTO base_login_audit(user_login_id,start_time,end_time,ip_address,host_name) VALUES(%d,%T,%T,%s,%s)', array(Acl::get_user(), $now, $now, $remote_address, $remote_host));
$_SESSION['base_login_audit'] = DB::Insert_ID('base_login_audit', 'id');
$_SESSION['base_login_audit_user'] = Acl::get_user();
}
}
示例6: user_settings
public static function user_settings()
{
self::get_options();
$ret_opts = array();
foreach (self::$options as $opt) {
unset($opt['link']);
$name = $opt['name'];
unset($opt['name']);
$opt = array_merge($opt, array('type' => 'bool', 'reload' => true, 'default' => 0));
$ret_opts[] = array('type' => 'group', 'label' => $opt['label'], 'elems' => array(array_merge($opt, array('values' => '', 'name' => $name . '_m')), array_merge($opt, array('values' => '', 'name' => $name . '_d')), array_merge($opt, array('values' => __('Menu') . ' • ' . __('Dashboard') . ' • ' . __('Launchpad'), 'name' => $name . '_l'))));
}
//trigger_error(print_r($ret_opts,true));
if (Acl::is_user()) {
return array(__('Quick Access') => $ret_opts);
}
return array();
}
示例7: header
<?php
/**
* Popup message to the user
* @author pbukowski@telaxus.com
* @copyright pbukowski@telaxus.com
* @license MIT
* @version 1.0
* @package epesi-Utils
* @subpackage Messenger
*/
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// date in the past
define('CID', false);
//define('READ_ONLY_SESSION',true);
require_once '../../../include.php';
ModuleManager::load_modules();
if (!Acl::is_user() || !isset($_REQUEST['id'])) {
return;
}
Utils_MessengerCommon::turn_off($_REQUEST['id']);
//DB::Execute('UPDATE utils_messenger_users SET done=1,done_on=%T WHERE user_login_id=%d AND message_id=%d',array(time(),Acl::get_user(),$_REQUEST['id']));
示例8: get_lang_code
public static function get_lang_code()
{
if (defined('FORCE_LANG_CODE')) {
return FORCE_LANG_CODE;
}
if (!isset(self::$lang_code)) {
if (!Acl::is_user() || ModuleManager::is_installed('Base/User/Settings') == -1 || !Variable::get('allow_lang_change', false)) {
return Variable::get('default_lang');
}
if (class_exists('Base_User_SettingsCommon')) {
self::$lang_code = Base_User_SettingsCommon::get('Base_Lang_Administrator', 'language');
}
}
return self::$lang_code;
}
示例9: mobile_menu
public static function mobile_menu()
{
if (Acl::is_user()) {
return array(__('Logout') => array('func' => 'logout', 'weight' => 100));
}
return array(__('Login') => 'mobile_login');
}
示例10: body_access
public static function body_access()
{
return Acl::is_user();
}
示例11: array
$def = array('default' => __('default server time (%s minutes)', array($time / 60)));
if ($time < 1800) {
$def['1800'] = __('30 minutes');
}
if ($time < 3600) {
$def['3600'] = __('1 hour');
}
if ($time < 7200) {
$def['7200'] = __('2 hours');
}
if ($time < 14400) {
$def['14400'] = __('4 hours');
}
if ($time < 28800) {
$def['28800'] = __('8 hours');
}
return array(__('Misc') => array(array('name' => 'time', 'label' => __('Keep session at least'), 'type' => 'select', 'values' => $def, 'default' => 28800, 'reload' => true)));
}
}
load_js('modules/Tools/SessionKeeper/sk.js');
$sys_time = ini_get("session.gc_maxlifetime");
$interval = $sys_time / 3;
if (Acl::is_user()) {
$time = Base_User_SettingsCommon::get('Tools/SessionKeeper', 'time');
if ($time == 'default') {
$time = $sys_time;
}
eval_js_once('SessionKeeper.maxtime=' . $time . ';' . 'SessionKeeper.interval=' . $interval . ';' . 'SessionKeeper.load()');
} else {
eval_js_once('SessionKeeper.maxtime=201600;' . 'SessionKeeper.interval=' . $interval . ';' . 'SessionKeeper.load()');
}
示例12: post_install_process
public static function post_install_process($val)
{
$comp_id = Utils_RecordBrowserCommon::new_record('company', array('company_name' => $val['cname'], 'short_name' => isset($val['sname']) ? $val['sname'] : '', 'address_1' => isset($val['address1']) ? $val['address1'] : '', 'address_2' => isset($val['address2']) ? $val['address2'] : '', 'country' => isset($val['country']) ? $val['country'] : '', 'zone' => isset($val['state']) ? $val['state'] : '', 'city' => isset($val['city']) ? $val['city'] : '', 'postal_code' => isset($val['postal']) ? $val['postal'] : '', 'phone' => isset($val['phone']) ? $val['phone'] : '', 'fax' => isset($val['fax']) ? $val['fax'] : '', 'permission' => '0', 'web_address' => isset($val['web']) ? $val['web'] : '', 'group' => array('other')));
if (Acl::is_user()) {
$mail = DB::GetOne('SELECT up.mail FROM user_password up WHERE up.user_login_id=%d', array(Acl::get_user()));
Utils_RecordBrowserCommon::new_record('contact', array('first_name' => $val['fname'], 'last_name' => $val['lname'], 'address_1' => isset($val['address1']) ? $val['address1'] : '', 'address_2' => isset($val['address2']) ? $val['address2'] : '', 'country' => isset($val['country']) ? $val['country'] : '', 'zone' => isset($val['state']) ? $val['state'] : '', 'city' => isset($val['city']) ? $val['city'] : '', 'postal_code' => isset($val['postal']) ? $val['postal'] : '', 'work_phone' => isset($val['phone']) ? $val['phone'] : '', 'fax' => isset($val['fax']) ? $val['fax'] : '', 'web_address' => isset($val['web']) ? $val['web'] : '', 'company_name' => $comp_id, 'login' => Acl::get_user(), 'permission' => '0', 'email' => $mail, 'group' => array('office', 'field')));
}
}
示例13: main_page
public function main_page()
{
if (!Acl::is_user()) {
print 'Log in to change your settings.';
}
$modules = array();
$admin_settings = $this->get_module_variable('admin_settings');
$us = ModuleManager::call_common_methods('user_settings');
foreach ($us as $name => $menu) {
if (!is_array($menu)) {
continue;
}
foreach ($menu as $k => $v) {
$display = false;
if (is_array($v)) {
foreach ($v as $k2 => $m2) {
if (isset($m2['type']) && $m2['type'] != 'hidden') {
$display = true;
break;
}
if ($display) {
break;
}
}
} else {
$display = true;
}
if (!$display) {
continue;
}
if (isset($modules[$k])) {
if (!is_string($v) && !isset($modules[$k]['external'])) {
$modules[$k]['module_names'][] = $name;
} else {
trigger_error('You cannot override this key: ' . $k, E_USER_ERROR);
}
} else {
if (!is_string($v)) {
$modules[$k] = array('action' => $this->create_unique_href(array('settings_branch' => $k)), 'module_names' => array($name));
} elseif (!$admin_settings) {
$modules[$k] = array('action' => $this->create_main_href($name, $v), 'module_names' => array($name), 'external' => true);
}
}
}
}
ksort($modules);
$buttons = array();
foreach ($modules as $caption => $arg) {
$icon = null;
sort($arg['module_names']);
foreach ($arg['module_names'] as $m) {
$f = array($m . 'Common', 'user_settings_icon');
if (is_callable($f)) {
$ret = call_user_func($f);
if (is_array($ret)) {
if (isset($ret[$caption])) {
$icon = $ret[$caption];
break;
}
} elseif (is_string($ret)) {
$icon = $ret;
break;
}
}
}
if (!$icon) {
foreach ($arg['module_names'] as $m) {
$new = Base_ThemeCommon::get_template_file($m, 'icon.png');
if ($new) {
$icon = $new;
}
}
}
$buttons[] = array('link' => '<a ' . $arg['action'] . '>' . $caption . '</a>', 'module' => $arg['module_names'], 'icon' => $icon);
}
$theme = $this->pack_module('Base/Theme');
$theme->assign('header', __('User Settings'));
$theme->assign('buttons', $buttons);
$theme->display();
}
示例14: get
/**
* Returns user setting.
* If user is logged in, returns user prefered setting,
* otherwise returns default value.
*
* @param string module name
* @param string variable name
* @return mixed user value
*/
public static function get($module, $name, $user = null)
{
if (!Acl::is_user()) {
return null;
}
if (!is_numeric($user) && $user !== null) {
return null;
}
if ($user === null) {
$user = Acl::get_user();
}
$module = str_replace('/', '_', $module);
if (!isset(self::$user_variables[$user])) {
self::$user_variables[$user] = array();
$ret = DB::Execute('SELECT variable, value, module FROM base_user_settings WHERE user_login_id=%d', array($user));
while ($row = $ret->FetchRow()) {
$val = @unserialize($row['value']);
if ($val !== false || $val === serialize(false)) {
self::$user_variables[$user][$row['module']][$row['variable']] = $val;
}
}
}
if (isset(self::$user_variables[$user][$module][$name])) {
return self::$user_variables[$user][$module][$name];
}
return self::$user_variables[$user][$module][$name] = self::get_admin($module, $name);
}
示例15: mobile_menu
public static function mobile_menu()
{
if (!Acl::is_user()) {
return array();
}
return array(__('Tray') => array('func' => 'mobile_tray', 'color' => 'blue'));
}