本文整理汇总了PHP中module_security::disallow_page_editing方法的典型用法代码示例。如果您正苦于以下问题:PHP module_security::disallow_page_editing方法的具体用法?PHP module_security::disallow_page_editing怎么用?PHP module_security::disallow_page_editing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类module_security
的用法示例。
在下文中一共展示了module_security::disallow_page_editing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect_browser
redirect_browser('/');
}
// addition for the 'all customer contacts' permission
// if user doesn't' have this permission then we only show ourselves in this list.
// todo: this is a problem - think about how this new "All Contacts" permission affects staff members viewing contact details, not just user contacts.
if ($user_id && !module_user::can_i('view', 'All ' . $contact_type_permission . ' Contacts', $contact_type, $contact_module_name)) {
if ($user_id != module_security::get_loggedin_id()) {
set_error('No permissions to view this contact');
redirect_browser(_BASE_HREF);
}
}
if ($user_id && !module_user::can_i('edit', 'All ' . $contact_type_permission . ' Contacts', $contact_type, $contact_module_name)) {
if ($user_id != module_security::get_loggedin_id()) {
// dont let them edit this page
ob_start();
module_security::disallow_page_editing();
}
}
// permission check.
if (!$user_id) {
// check if can create.
module_security::check_page(array('category' => $contact_type, 'page_name' => 'Contacts', 'module' => 'user', 'feature' => 'create'));
} else {
// check if can view/edit.
module_security::check_page(array('category' => $contact_type, 'page_name' => 'Contacts', 'module' => 'user', 'feature' => 'edit'));
}
if ($user_id > 0 && $user['user_id'] == $user_id) {
$module->page_title = _l('Contact: %s', $user['name']);
} else {
$module->page_title = _l('Contact: %s', _l('New'));
}