本文整理汇总了PHP中SecurityGroup::getSecurityModules方法的典型用法代码示例。如果您正苦于以下问题:PHP SecurityGroup::getSecurityModules方法的具体用法?PHP SecurityGroup::getSecurityModules怎么用?PHP SecurityGroup::getSecurityModules使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SecurityGroup
的用法示例。
在下文中一共展示了SecurityGroup::getSecurityModules方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SecurityGroup
$securitysuite_inherit_assigned = '';
if (isset($sugar_config['securitysuite_inherit_assigned']) && $sugar_config['securitysuite_inherit_assigned'] == true) {
$securitysuite_inherit_assigned = 'CHECKED';
}
$xtpl->assign('securitysuite_inherit_assigned', $securitysuite_inherit_assigned);
//default security groups
$groupFocus = new SecurityGroup();
$defaultGroups = $groupFocus->retrieveDefaultGroups();
$defaultGroup_string = "";
foreach ($defaultGroups as $default_id => $defaultGroup) {
$defaultGroup_string .= "\n\t<tr>\n\t<td class='dataLabel' width='30%'>\n\t\t" . $mod_strings['LBL_GROUP'] . " " . $defaultGroup['group'] . "\n\t</td>\n\t<td class='dataField' width='30%'>\n\t\t" . $mod_strings['LBL_MODULE'] . " " . $defaultGroup['module'] . "\n\t</td>\n\t<td class='dataLabel' width='40%'>\n\t\t<input type='submit' tabindex='1' class='button' onclick=\"this.form.remove_default_id.value='" . $default_id . "'; this.form.action.value='SaveConfig'; this.form.return_module.value='SecurityGroups'; this.form.return_action.value='config';\" value='" . $mod_strings['LBL_REMOVE_BUTTON_LABEL'] . "'/>\n\t</td>\n\t</tr>";
}
$xtpl->assign("DEFAULT_GROUPS", $defaultGroup_string);
$groups = $groupFocus->get_list("name");
$options = array("" => "");
foreach ($groups['list'] as $group) {
$options[$group->id] = $group->name;
}
$xtpl->assign("SECURITY_GROUP_OPTIONS", get_select_options_with_id($options, ""));
//$moduleList = $app_list_strings['moduleList'];
//require_once('modules/Studio/DropDowns/DropDownHelper.php');
//$dh = new DropDownHelper();
//$dh->getDropDownModules();
//$moduleList = array_keys($dh->modules);
$security_modules = $groupFocus->getSecurityModules();
$security_modules["All"] = $mod_strings["LBL_ALL_MODULES"];
//rost fix
ksort($security_modules);
$xtpl->assign("MODULE_OPTIONS", get_select_options_with_id($security_modules, "All"));
$xtpl->parse("main");
$xtpl->out("main");
示例2: SecurityGroup
function inherit_parent(&$focus, $isUpdate)
{
global $sugar_config;
//new record or if update from soap api for cases or bugs
//TEST FOR PORTAL NOTES
//if((!$isUpdate || ($isUpdate && !empty($focus->note_id) && ($focus->object_name == "Case" || $focus->object_name == "Bug")))
if (!$isUpdate && isset($sugar_config['securitysuite_inherit_parent']) && $sugar_config['securitysuite_inherit_parent'] == true) {
$focus_module_dir = $focus->module_dir;
$focus_id = $focus->id;
//inherit only for those that support Security Groups
$groupFocus = new SecurityGroup();
$security_modules = $groupFocus->getSecurityModules();
//if(!in_array($focus_module_dir,$security_modules)) {
if (!in_array($focus_module_dir, array_keys($security_modules))) {
//rost fix2
return;
//don't inherit for this module
}
//from subpanel
//PHP Notice error fix
$parent_type = "";
$parent_id = "";
if (isset($_REQUEST['relate_to']) && isset($_REQUEST['relate_id'])) {
//relate_to is not guaranteed to be a module name anymore.
//if it isn't load the relationship and find the module name that way
if (!in_array($_REQUEST['relate_to'], array_keys($security_modules))) {
//check to see if relate_to is the relationship name
require_once 'modules/Relationships/Relationship.php';
$rel_module = Relationship::get_other_module($_REQUEST['relate_to'], $focus_module_dir, $focus->db);
if (isset($rel)) {
$parent_type = $rel_module;
$parent_id = $_REQUEST['relate_id'];
}
} else {
$parent_type = $_REQUEST['relate_to'];
$parent_id = $_REQUEST['relate_id'];
}
}
if (isset($_SESSION['portal_id'])) {
$parent_id = $_SESSION['user_id'];
//soap stores contact id in user_id field
$parent_type = "Contacts";
}
//from activity type creation
if ((empty($parent_type) || empty($parent_id)) && isset($_REQUEST['parent_type']) && isset($_REQUEST['parent_id'])) {
$parent_type = $_REQUEST['parent_type'];
$parent_id = $_REQUEST['parent_id'];
}
//full form from subpanel
if ((empty($parent_type) || empty($parent_id)) && isset($_REQUEST['return_module']) && isset($_REQUEST['return_id'])) {
$parent_type = $_REQUEST['return_module'];
$parent_id = $_REQUEST['return_id'];
}
/** need to find relate fields...for example for Cases look to see if account_id is set */
//allow inheritance for all relate field types....iterate through and inherit each related field
//if(empty($parent_type) || empty($parent_id)) {
foreach ($focus->field_name_map as $name => $def) {
if ($def['type'] == 'relate' && isset($def['id_name']) && isset($def['module']) && strtolower($def['module']) != "users") {
if (isset($_REQUEST[$def['id_name']])) {
$relate_parent_id = $_REQUEST[$def['id_name']];
$relate_parent_type = $def['module'];
SecurityGroup::inherit_parentQuery($focus, $relate_parent_type, $relate_parent_id, $focus_id, $focus_module_dir);
} else {
if (isset($_SESSION['portal_id']) && isset($_SESSION[$def['id_name']])) {
//catch soap account
$relate_parent_id = $_SESSION[$def['id_name']];
$relate_parent_type = $def['module'];
SecurityGroup::inherit_parentQuery($focus, $relate_parent_type, $relate_parent_id, $focus_id, $focus_module_dir);
}
}
}
}
//}
if (!empty($parent_type) && !empty($parent_id)) {
// && $parent_type != "Emails" && $parent_type != "Meetings") {
SecurityGroup::inherit_parentQuery($focus, $parent_type, $parent_id, $focus_id, $focus_module_dir);
}
//end if parent type/id
}
//end if new record
}
示例3: display
//.........这里部分代码省略.........
$this->th->ss->assign('view', $this->view);
//Calculate time & date formatting (may need to calculate this depending on a setting)
global $timedate;
$this->th->ss->assign('CALENDAR_DATEFORMAT', $timedate->get_cal_date_format());
$this->th->ss->assign('USER_DATEFORMAT', $timedate->get_user_date_format());
$time_format = $timedate->get_user_time_format();
$this->th->ss->assign('TIME_FORMAT', $time_format);
$date_format = $timedate->get_cal_date_format();
$time_separator = ':';
if (preg_match('/\\d+([^\\d])\\d+([^\\d]*)/s', $time_format, $match)) {
$time_separator = $match[1];
}
// Create Smarty variables for the Calendar picker widget
$t23 = strpos($time_format, '23') !== false ? '%H' : '%I';
if (!isset($match[2]) || $match[2] == '') {
$this->th->ss->assign('CALENDAR_FORMAT', $date_format . ' ' . $t23 . $time_separator . '%M');
} else {
$pm = $match[2] == 'pm' ? '%P' : '%p';
$this->th->ss->assign('CALENDAR_FORMAT', $date_format . ' ' . $t23 . $time_separator . '%M' . $pm);
}
$this->th->ss->assign('CALENDAR_FDOW', $current_user->get_first_day_of_week());
$this->th->ss->assign('TIME_SEPARATOR', $time_separator);
$seps = get_number_seperators();
$this->th->ss->assign('NUM_GRP_SEP', $seps[0]);
$this->th->ss->assign('DEC_SEP', $seps[1]);
if ($this->view == 'EditView') {
$height = $current_user->getPreference('text_editor_height');
$width = $current_user->getPreference('text_editor_width');
$height = isset($height) ? $height : '300px';
$width = isset($width) ? $width : '95%';
$this->th->ss->assign('RICH_TEXT_EDITOR_HEIGHT', $height);
$this->th->ss->assign('RICH_TEXT_EDITOR_WIDTH', $width);
} else {
$this->th->ss->assign('RICH_TEXT_EDITOR_HEIGHT', '100px');
$this->th->ss->assign('RICH_TEXT_EDITOR_WIDTH', '95%');
}
$this->th->ss->assign('SHOW_VCR_CONTROL', $this->showVCRControl);
$str = $this->showTitle($showTitle);
//Use the output filter to trim the whitespace
$this->th->ss->load_filter('output', 'trimwhitespace');
$str .= $this->th->displayTemplate($this->module, $form_name, $this->tpl, $ajaxSave, $this->defs);
/* BEGIN - SECURITY GROUPS */
//if popup select add panel if user is a member of multiple groups to metadataFile
global $sugar_config;
if (isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true && empty($this->focus->fetched_row['id']) && $this->focus->module_dir != "Users" && $this->focus->module_dir != "SugarFeed") {
//there are cases such as uploading an attachment to an email template where the request module may
//not be the same as the current bean module. If that happens we can just skip it
//however...let quickcreate through
if ($this->view != 'QuickCreate' && (empty($_REQUEST['module']) || $_REQUEST['module'] != $this->focus->module_dir)) {
return $str;
}
require_once 'modules/SecurityGroups/SecurityGroup.php';
$groupFocus = new SecurityGroup();
$security_modules = $groupFocus->getSecurityModules();
if (in_array($this->focus->module_dir, array_keys($security_modules))) {
global $current_user;
$group_count = $groupFocus->getMembershipCount($current_user->id);
if ($group_count > 1) {
$groups = $groupFocus->getUserSecurityGroups($current_user->id);
$group_options = '';
foreach ($groups as $group) {
$group_options .= '<option value="' . $group['id'] . '" label="' . $group['name'] . '" selected="selected">' . $group['name'] . '</option>';
}
//multilingual support
global $current_language;
$ss_mod_strings = return_module_language($current_language, 'SecurityGroups');
$lbl_securitygroups_select = $ss_mod_strings['LBL_GROUP_SELECT'];
$lbl_securitygroups = $ss_mod_strings['LBL_LIST_FORM_TITLE'];
$group_panel = <<<EOQ
<div class="edit view edit508 " id="detailpanel_securitygroups">
<h4>
{$lbl_securitygroups_select}
</h4>
<table width="100%" cellspacing="1" cellpadding="0" border="0" class="edit view panelContainer" id="LBL_PANEL_SECURITYGROUPS">
<tbody><tr>
<td width="12.5%" valign="top" scope="col" id="account_type_label">
{$lbl_securitygroups}:
</td>
<td width="37.5%" valign="top">
<select title="" id="securitygroup_list" name="securitygroup_list[]" multiple="multiple" size="{$group_count}">
{$group_options}
</select>
</td>
</tr>
</tbody></table>
</div>
EOQ;
$group_panel = preg_replace("/[\r\n]+/", "", $group_panel);
$group_panel_append = <<<EOQ
<script>
\$('#{$form_name}_tabs div:first').append(\$('{$group_panel}'));
</script>
EOQ;
$str .= $group_panel_append;
}
}
}
/* END - SECURITY GROUPS */
return $str;
}
示例4: confirm_massassign
function mass_assign($event, $arguments)
{
$action = $_REQUEST['action'];
$module = $_REQUEST['module'];
$no_mass_assign_list = array("Emails" => "Emails", "ACLRoles" => "ACLRoles");
//,"Users"=>"Users");
//check if security suite enabled
$action = strtolower($action);
if (isset($module) && ($action == "list" || $action == "index" || $action == "listview") && (!isset($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] != true) && !array_key_exists($module, $no_mass_assign_list)) {
global $current_user;
if (is_admin($current_user) || ACLAction::getUserAccessLevel($current_user->id, "SecurityGroups", 'access') == ACL_ALLOW_ENABLED) {
require_once 'modules/SecurityGroups/SecurityGroup.php';
$groupFocus = new SecurityGroup();
$security_modules = $groupFocus->getSecurityModules();
//if(in_array($module,$security_modules)) {
if (in_array($module, array_keys($security_modules))) {
global $app_strings;
global $current_language;
$current_module_strings = return_module_language($current_language, 'SecurityGroups');
$form_header = get_form_header($current_module_strings['LBL_MASS_ASSIGN'], '', false);
$groups = $groupFocus->get_list("name", "", 0, -99, -99);
$options = array("" => "");
foreach ($groups['list'] as $group) {
$options[$group->id] = $group->name;
}
$group_options = get_select_options_with_id($options, "");
$mass_assign = <<<EOQ
<script type="text/javascript" language="javascript">
function confirm_massassign(del,start_string, end_string) {
\tif (del == 1) {
\t\treturn confirm( start_string + sugarListView.get_num_selected() + end_string);
\t}
\telse {
\t\treturn confirm( start_string + sugarListView.get_num_selected() + end_string);
\t}
}
function send_massassign(mode, no_record_txt, start_string, end_string, del) {
\tif(!sugarListView.confirm_action(del, start_string, end_string))
\t\treturn false;
\tif(document.MassAssign_SecurityGroups.massassign_group.selectedIndex == 0) {
\t\talert("Please select a group and try again.");
\t\treturn false;\t
\t}
\t
\tif (document.MassUpdate.select_entire_list &&
\t\tdocument.MassUpdate.select_entire_list.value == 1)
\t\tmode = 'entire';
\telse if (document.MassUpdate.massall.checked == true)
\t\tmode = 'page';
\telse
\t\tmode = 'selected';
\tvar ar = new Array();
\tif(del == 1) {
\t\tvar deleteInput = document.createElement('input');
\t\tdeleteInput.name = 'Delete';
\t\tdeleteInput.type = 'hidden';
\t\tdeleteInput.value = true;
\t\tdocument.MassAssign_SecurityGroups.appendChild(deleteInput);
\t}
\tswitch(mode) {
\t\tcase 'page':
\t\t\tdocument.MassAssign_SecurityGroups.uid.value = '';
\t\t\tfor(wp = 0; wp < document.MassUpdate.elements.length; wp++) {
\t\t\t\tif(typeof document.MassUpdate.elements[wp].name != 'undefined'
\t\t\t\t\t&& document.MassUpdate.elements[wp].name == 'mass[]' && document.MassUpdate.elements[wp].checked) {
\t\t\t\t\t\t\tar.push(document.MassUpdate.elements[wp].value);
\t\t\t\t}
\t\t\t}
\t\t\tdocument.MassAssign_SecurityGroups.uid.value = ar.join(',');
\t\t\tif(document.MassAssign_SecurityGroups.uid.value == '') {
\t\t\t\talert(no_record_txt);
\t\t\t\treturn false;
\t\t\t}
\t\t\tbreak;
\t\tcase 'selected':
\t\t\tfor(wp = 0; wp < document.MassUpdate.elements.length; wp++) {
\t\t\t\tif(typeof document.MassUpdate.elements[wp].name != 'undefined'
\t\t\t\t\t&& document.MassUpdate.elements[wp].name == 'mass[]'
\t\t\t\t\t\t&& document.MassUpdate.elements[wp].checked) {
\t\t\t\t\t\t\tar.push(document.MassUpdate.elements[wp].value);
\t\t\t\t}
\t\t\t}
\t\t\tif(document.MassAssign_SecurityGroups.uid.value != '') document.MassAssign_SecurityGroups.uid.value += ',';
\t\t\tdocument.MassAssign_SecurityGroups.uid.value += ar.join(',');
\t\t\tif(document.MassAssign_SecurityGroups.uid.value == '') {
\t\t\t\talert(no_record_txt);
\t\t\t\treturn false;
\t\t\t}
\t\t\tbreak;
\t\tcase 'entire':
\t\t\tvar entireInput = document.createElement('input');
\t\t\tentireInput.name = 'entire';
\t\t\tentireInput.type = 'hidden';
\t\t\tentireInput.value = 'index';
//.........这里部分代码省略.........
示例5: testgetSecurityModules
public function testgetSecurityModules()
{
//unset and reconnect Db to resolve mysqli fetch exeception
global $db;
unset($db->database);
$db->checkConnection();
$securityGroup = new SecurityGroup();
$expected = array('Meetings', 'Cases', 'AOS_Products', 'Opportunities', 'FP_Event_Locations', 'Tasks', 'jjwg_Markers', 'EmailTemplates', 'Campaigns', 'jjwg_Areas', 'Contacts', 'AOS_Contracts', 'AOS_Quotes', 'Bugs', 'Users', 'Documents', 'AOS_Invoices', 'Notes', 'AOW_WorkFlow', 'ProspectLists', 'AOK_KnowledgeBase', 'AOS_PDF_Templates', 'Calls', 'Accounts', 'Leads', 'Emails', 'ProjectTask', 'Project', 'FP_events', 'AOR_Reports', 'Prospects', 'ACLRoles', 'jjwg_Maps', 'AOS_Product_Categories', 'Spots' => 'Spots');
$actual = $securityGroup->getSecurityModules();
$actualKeys = array_keys($actual);
sort($expected);
sort($actualKeys);
$this->assertSame($expected, $actualKeys);
}