本文整理汇总了PHP中module_security::can_user_login方法的典型用法代码示例。如果您正苦于以下问题:PHP module_security::can_user_login方法的具体用法?PHP module_security::can_user_login怎么用?PHP module_security::can_user_login使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类module_security
的用法示例。
在下文中一共展示了module_security::can_user_login方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$columns['email'] = array('title' => 'Email Address', 'callback' => function ($user) {
echo htmlspecialchars($user['email']);
});
$columns['role'] = array('title' => 'Role / Permissions', 'callback' => function ($user) use($roles) {
if ($user['user_id'] == 1) {
echo _l('Everything');
} else {
if (isset($user['roles']) && $user['roles']) {
foreach ($user['roles'] as $role) {
echo $roles[$role['security_role_id']]['name'];
}
}
}
});
$columns['can_login'] = array('title' => 'Can Login', 'callback' => function ($user) {
echo module_security::can_user_login($user['user_id']) ? _l('Yes') : _l('No');
});
$table_manager->set_columns($columns);
$table_manager->row_callback = function ($row_data) {
// load the full vendor data before displaying each row so we have access to more details
return module_user::get_user($row_data['user_id']);
};
$table_manager->set_rows($users);
if (class_exists('module_extra', false)) {
$table_manager->display_extra('user', function ($user) {
module_extra::print_table_data('user', $user['user_id']);
});
}
$table_manager->pagination = true;
$table_manager->print_table();
?>
示例2: _h
<td>
<input type="password" name="password_new2" value="" />
<?php
_h('Please confirm your new password here a second time.');
?>
</td>
</tr>
</table>
<?php
$fieldset_data['elements']['password'] = array('title' => _l('Change Password'), 'fields' => array(ob_get_clean()));
}
}
if ((module_user::can_i('view', 'Users Passwords', 'Config') && $user_id == module_security::get_loggedin_id() || module_user::can_i('edit', 'Users Passwords', 'Config')) && (int) $user_id > 0 && $user_id != "new") {
$fieldset_data['elements']['auto'] = array('title' => _l('Auto Login Link'), 'fields' => array('<a href="' . module_security::generate_auto_login_link($user_id) . '">' . _l('right click - copy link') . '</a> ', _hr('If you give this link to a user (or bookmark it for yourself) then it will log in automatically. To re-set an auto-login link simply change your password to something new.')));
}
if (!module_security::can_user_login($user_id)) {
$fieldset_data['elements']['warninglogin'] = array('warning' => _l('(note: this user does not have login permissions yet - login will not work)'));
}
echo module_form::generate_fieldset($fieldset_data);
// todo - hook in here for a user configuration area
// modules can load configuration variables in here.
// hmm, is this the same as user roles. i guess it is, we'll just use user roles for now.
?>
<?php
/*if(module_user::can_i('edit','Fine Tune Permissions','Config')){
$user_permissions = module_security::get_user_permissions($user_id);
if($user_id && !$current_role){
// do they have any permissions at all?
if(!$user_permissions){