当前位置: 首页>>代码示例>>PHP>>正文


PHP module_security::link_open_role方法代码示例

本文整理汇总了PHP中module_security::link_open_role方法的典型用法代码示例。如果您正苦于以下问题:PHP module_security::link_open_role方法的具体用法?PHP module_security::link_open_role怎么用?PHP module_security::link_open_role使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在module_security的用法示例。


在下文中一共展示了module_security::link_open_role方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 */
$fieldset_data = array('title' => _l('User Security'), 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array());
if (module_user::can_i('edit', 'Users Permissions', 'Config')) {
    if ($user_id == 1) {
        $fieldset_data['elements']['role'] = array('title' => _l('User Role'), 'fields' => array(_l('All Permissions')));
    } else {
        $user_roles = isset($user['roles']) && is_array($user['roles']) ? $user['roles'] : array();
        $roles = module_security::get_roles();
        $roles_attributes = array();
        foreach ($roles as $role) {
            $roles_attributes[$role['security_role_id']] = $role['name'];
        }
        $current_role = current($user_roles);
        $fieldset_data['elements']['role'] = array('title' => _l('User Role'), 'fields' => array(array('type' => 'select', 'name' => 'role_id', 'value' => isset($current_role['security_role_id']) ? $current_role['security_role_id'] : false, 'options' => $roles_attributes)));
        if (module_security::can_i('view', 'Security Roles', 'Security')) {
            $fieldset_data['elements']['role']['fields'][] = ' <a href="' . module_security::link_open_role($current_role['security_role_id']) . '">edit</a> ';
        }
        $fieldset_data['elements']['role']['fields'][] = _hr('You can setup a list of permissions to re-use over and over again under Settings > Roles. This will control what parts of the application this user can access (if any). ');
    }
}
$fieldset_data['elements']['username'] = array('title' => _l('Username'), 'fields' => array(_l('(same as email address)')));
?>
<!-- fake fields are a workaround for chrome autofill getting the wrong fields -->
<input style="display:none" type="text" name="fakeusernameremembered"/>
<input style="display:none" type="password" name="fakepasswordremembered"/>
<?php 
if ($user_id == module_security::get_loggedin_id() || module_user::can_i('edit', 'Users Passwords', 'Config')) {
    // do we allow this user to create a password ? or do they have to enter their old password first to change it.
    if (!$user['password'] || module_user::can_i('create', 'Users Passwords', 'Config') || isset($_REQUEST['reset_password']) && $_REQUEST['reset_password'] == module_security::get_auto_login_string($user['user_id'])) {
        $fieldset_data['elements']['password'] = array('title' => _l('Set Password'), 'fields' => array(array('type' => 'password', 'name' => 'password_new', 'autocomplete' => 'off', 'value' => '', 'class' => 'no_permissions', 'help' => 'Giving this user a password and login permissions will let them gain access to this system. Depending on the permissions you give them will decide what parts of the system they can access.')));
    } else {
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:user_admin_edit_login.php

示例2: redirect_browser

/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
if (!module_config::can_i('view', 'Settings') || !module_security::can_i('view', 'Security Roles', 'Security')) {
    redirect_browser(_BASE_HREF);
}
$search = isset($_REQUEST['search']) && is_array($_REQUEST['search']) ? $_REQUEST['search'] : array();
$roles = $module->get_roles($search);
$header = array('type' => 'h2', 'title' => _l('Security Roles'), 'main' => true, 'button' => array('title' => 'Add New Role', 'type' => 'add', 'url' => module_security::link_open_role('new')));
print_heading($header);
?>



<form action="" method="post">


<?php 
/** START TABLE LAYOUT **/
$table_manager = module_theme::new_table_manager();
$columns = array();
$columns['name'] = array('title' => 'Name', 'callback' => function ($role) use(&$module) {
    echo $module->link_open_role($role['security_role_id'], true);
}, 'cell_class' => 'row_action');
开发者ID:sgh1986915,项目名称:php-crm,代码行数:30,代码来源:security_role_list.php

示例3: array

        $security_role_id = 'new';
    }
}
if ($security_role_id == 'new' || !$security_role_id) {
    if (class_exists('module_security', false)) {
        module_security::check_page(array('category' => 'Security', 'page_name' => 'Security Roles', 'module' => 'security', 'feature' => 'create'));
    }
    $security_role = array('security_role_id' => 'new', 'name' => '');
}
if (module_security::can_i('edit', 'Security Roles', 'Security') && isset($_REQUEST['delete_security_permission_id'])) {
    $id = (int) $_REQUEST['delete_security_permission_id'];
    if ($id > 0) {
        delete_from_db('security_permission', 'security_permission_id', $id);
        delete_from_db('security_role_perm', 'security_permission_id', $id);
    }
    redirect_browser(module_security::link_open_role($security_role_id) . '&advanced');
}
if (isset($_REQUEST['export_json'])) {
    $export_json = array();
}
?>


	
<form action="" method="post">
	<input type="hidden" name="_process" value="save_security_role" />
	<input type="hidden" name="security_role_id" value="<?php 
echo $security_role_id;
?>
" />
开发者ID:sgh1986915,项目名称:php-crm,代码行数:30,代码来源:security_role_edit.php


注:本文中的module_security::link_open_role方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。