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


PHP SecurityGroup类代码示例

本文整理汇总了PHP中SecurityGroup的典型用法代码示例。如果您正苦于以下问题:PHP SecurityGroup类的具体用法?PHP SecurityGroup怎么用?PHP SecurityGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: get_list_view_data

 function get_list_view_data()
 {
     $data = parent::get_list_view_data();
     $delete = '';
     $group_owner = false;
     $securitygroup_name = "";
     if (empty($data['SECURITYGROUP_ID'])) {
         $securitygroup_name = "All";
     } else {
         require_once 'modules/SecurityGroups/SecurityGroup.php';
         $securitygroup = new SecurityGroup();
         $securitygroup->retrieve($data['SECURITYGROUP_ID']);
         $securitygroup_name = $securitygroup->name;
         if ($securitygroup->assigned_user_id == $GLOBALS['current_user']->id) {
             $group_owner = true;
         }
     }
     if (is_admin($GLOBALS['current_user']) || $data['CREATED_BY'] == $GLOBALS['current_user']->id || $group_owner) {
         $delete = SugarThemeRegistry::current()->getImage('delete_inline', 'width="12" height="12" border="0" align="absmiddle" style="vertical-align: bottom;" onclick=\'Message.deleteMessage("' . $data['ID'] . '", "{this.id}")\'', null, null, '.gif', '');
     }
     $username = "";
     if (empty($data['CREATED_BY'])) {
         $username = "Unknown";
     } else {
         require_once 'modules/Users/User.php';
         $user = new User();
         $user->retrieve($data['CREATED_BY']);
         $username = $user->user_name;
     }
     $data['NAME'] = $data['DESCRIPTION'];
     $data['NAME'] = '<div class="list view" style="padding:5px;border:none;">' . html_entity_decode($data['NAME']);
     $data['NAME'] .= '<div class="byLineBox" style="padding-top: 2px"><span class="byLineLeft">' . $username . ' [' . $securitygroup_name . ']';
     $data['NAME'] .= '&nbsp;</span><span style="cursor: pointer;" class="byLineRight"> ' . $this->getTimeLapse($data['DATE_ENTERED']) . ' &nbsp;' . $delete . '</span></div>';
     return $data;
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:35,代码来源:SecurityGroupMessage.php

示例2: handle

    function handle($request) {
        $groupIdParamName = 'group';
        $groupId = Form::getField($request, $groupIdParamName);
        if (strlen($groupId) == 0) {
            die(IsatisText::getText("MissingParameter").": ".$groupIdParamName);
        }
        $g = SecurityGroup::getById($groupId);
        if ($g == NULL) {
            die(Text::getText("GroupNotFound").": '".$groupId."'");
        }
        $allPermissions = SecurityPermission::getAll();
        $allResources = SecurityResource::getAll();

        foreach ($allResources as $res) {
            foreach ($allPermissions as $perm) {
                $fieldName = "res".$res->getId()."_perm".$perm->getId();
                $value = Form::getField($request, $fieldName);
                if ($value == "on") {
                    if (!$g->hasPermission($res, $perm)) {
                        $g->addPermission($res, $perm);
                    }
                } else {
                    $g->removePermission($res, $perm);
                }
            }
        }
        return $g;
    }
开发者ID:elecnix,项目名称:resaccman,代码行数:28,代码来源:GroupPermissionsForm.php

示例3: printContent

 function printContent() {
     ?>
       <table border="0">
         <tr bgcolor=<?=BGCOLOR_ALT?>>
           <th>#</th>
           <? if (SecurityGroup::havePermission("DELETE")) { ?>
             <th></th>
           <? } ?>
           <th><?=Text::getText("Name")?></th>
           <th>&nbsp;</th>
           <th>&nbsp;</th>
         </tr>
         <? $bg = TRUE; ?>
         <? foreach ($this->groups as $g) { ?>
           <? $bg = !$bg; ?>
           <tr<? if ($bg) { ?> bgcolor=<?=BGCOLOR_ALT?><? } ?>>
             <td>&nbsp;<?=$g->getId()?>&nbsp;</td>
             <? if (SecurityGroup::havePermission("DELETE")) { ?>
               <td><a href="<?=$this->groupDeletePage?>?<?=$this->groupDeleteParamGroupId?>=<?=$g->getId()?>" onClick="return confirm('<?=Text::getText('ConfirmDeleteGroup')?>')"><img src="<?=$this->imgDeleteSrc?>" border="0" alt="<?=Text::getText('Delete')?>"></a></td>
             <? } ?>
             <td>&nbsp;<a href="<?=$this->groupEditPage?>?<?=$this->groupEditParamGroupId?>=<?=$g->getId()?>"><?=$g->getName()?></a>&nbsp;</td>
             <td>&nbsp;<a href="<?=$this->groupMembersPage?>?<?=$this->groupMembersParamGroupId?>=<?=$g->getId()?>"><?=Text::getText("Members")?></a>&nbsp;</td>
             <td>&nbsp;<a href="<?=$this->groupPermissionsPage?>?<?=$this->groupPermissionsParamGroupId?>=<?=$g->getId()?>"><?=Text::getText("Permissions")?></a>&nbsp;</td>
           </tr>
         <? } ?>
       </table>
     <?
 }
开发者ID:elecnix,项目名称:resaccman,代码行数:28,代码来源:GroupList.php

示例4: display

 function display()
 {
     $this->fromModuleBuilder = isset($_REQUEST['MB']) || !empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio';
     if ($this->fromModuleBuilder) {
         return;
         //no support for MB
     }
     global $current_user;
     global $mod_strings;
     $smarty = new Sugar_Smarty();
     $smarty->assign('title', $mod_strings['LBL_DEVELOPER_TOOLS']);
     $smarty->assign('question', $mod_strings['LBL_REMOVE_LAYOUT']);
     $smarty->assign('mod_strings', $mod_strings);
     $module_name = $_REQUEST['view_module'];
     $smarty->assign('view_module', $module_name);
     $groupLayout = $_REQUEST['grpLayout'];
     $smarty->assign('groupLayout', $groupLayout);
     require_once 'modules/SecurityGroups/SecurityGroup.php';
     $groupFocus = new SecurityGroup();
     $groupFocus->retrieve($groupLayout);
     $groupName = $groupFocus->name;
     // set up language files
     //$smarty->assign ( 'language', $parser->getLanguage() ) ; // for sugar_translate in the smarty template
     //$smarty->assign('from_mb',$this->fromModuleBuilder);
     $mb = new ModuleBuilder();
     if (!isset($_REQUEST['view_package'])) {
         $_REQUEST['view_package'] = 'studio';
     }
     $module =& $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
     $package = $mb->packages[$_REQUEST['view_package']];
     $package->loadModuleTitles();
     $ajax = new AjaxCompose();
     $ajax->addCrumb(translate('LBL_STUDIO', 'ModuleBuilder'), 'ModuleBuilder.main("studio")');
     $ajax->addCrumb(translate($module_name), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $module_name . '")');
     $ajax->addCrumb(translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=addlayout&layouts=1&view_module=' . $module_name . '")');
     $ajax->addCrumb(translate($groupName), '');
     $ajax->addCrumb($mod_strings['LBL_REMOVE_LAYOUT'], '');
     //$ajax->addSection ( 'center', $moduleName . ' ' . translate('LBL_ADD_LAYOUT'),
     $ajax->addSection('center', $mod_strings['LBL_ADD_LAYOUT'], $smarty->fetch('modules/ModuleBuilder/tpls/removegrouplayoutprompt.tpl'));
     echo $ajax->getJavascript();
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:41,代码来源:view.removegrouplayoutprompt.php

示例5: getAssignableUsers

 private function getAssignableUsers()
 {
     if ($this->distributionMethod == 'singleUser') {
         return array();
     }
     $distributionOptions = $this->getDistributionOptions();
     if (empty($distributionOptions)) {
         return array();
     }
     switch ($distributionOptions[0]) {
         case 'security_group':
             if (file_exists('modules/SecurityGroups/SecurityGroup.php')) {
                 require_once 'modules/SecurityGroups/SecurityGroup.php';
                 $security_group = new SecurityGroup();
                 $security_group->retrieve($distributionOptions[1]);
                 $group_users = $security_group->get_linked_beans('users', 'User');
                 $users = array();
                 $r_users = array();
                 if ($distributionOptions[2] != '') {
                     $r_users = $this->getRoleUsers($distributionOptions[2]);
                 }
                 foreach ($group_users as $group_user) {
                     if ($distributionOptions[2] != '' && !isset($r_users[$group_user->id])) {
                         continue;
                     }
                     $users[$group_user->id] = $group_user->name;
                 }
                 break;
             }
             //No Security Group module found - fall through.
         //No Security Group module found - fall through.
         case 'role':
             $users = $this->getRoleUsers($distributionOptions[2]);
             break;
         case 'all':
         default:
             $users = get_user_array(false);
             break;
     }
     return $users;
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:41,代码来源:AOPAssignManager.php

示例6: display

 function display($preview = false)
 {
     $packageName = isset($_REQUEST['view_package']) ? $_REQUEST['view_package'] : '';
     require_once 'modules/ModuleBuilder/parsers/ParserFactory.php';
     $parser = ParserFactory::getParser($this->editLayout, $this->editModule, $packageName);
     $smarty = parent::constructSmarty($parser);
     $smarty->assign('action', 'searchViewSave');
     $smarty->assign('view', $this->editLayout);
     $smarty->assign('helpName', 'searchViewEditor');
     $smarty->assign('helpDefault', 'modify');
     /* BEGIN - SECURITY GROUPS */
     $groupLayout = "";
     if (!empty($_REQUEST['grpLayout'])) {
         $groupLayout = $_REQUEST['grpLayout'];
     }
     global $groupName;
     $groupName = "Default";
     if (!isset($groupLayout) || empty($groupLayout)) {
         $groupLayout = "";
     } else {
         //Get group name for display
         require_once 'modules/SecurityGroups/SecurityGroup.php';
         $groupFocus = new SecurityGroup();
         $groupFocus->retrieve($groupLayout);
         $groupName = $groupFocus->name;
     }
     $smarty->assign('grpLayout', $groupLayout);
     /* END - SECURITY GROUPS */
     if ($preview) {
         echo $smarty->fetch("modules/ModuleBuilder/tpls/Preview/listView.tpl");
     } else {
         $ajax = $this->constructAjax();
         $ajax->addSection('center', translate($this->title), $smarty->fetch("modules/ModuleBuilder/tpls/listView.tpl"));
         echo $ajax->getJavascript();
     }
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:36,代码来源:view.searchview.php

示例7: inherit_parent

 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
 }
开发者ID:isrealconsulting,项目名称:ic-suite,代码行数:81,代码来源:SecurityGroup.php

示例8: if

"><?php 
echo Text::getText("Members");
?>
</a>&nbsp;</td>
            <td>&nbsp;<a href="groupPermissions.php?id=<?php 
echo $g->getId();
?>
"><?php 
echo Text::getText("Permissions");
?>
</a>&nbsp;</td>
        </tr>
    <? } ?>
</table>

<? if (SecurityGroup::havePermission("ADD")) { ?>
    <h3><?php 
echo Text::getText("AddGroup");
?>
</h3>
    <form method="POST" action="groupAdd.php">
        <input type="hidden" name="action" value="save">
        <table border="0" cellpadding="2">
            <tr>
                <th><?php 
echo Text::getText("Name");
?>
</th>
                <td><input type="text" name="name" value=""></td>
            </tr>
            <tr>
开发者ID:elecnix,项目名称:smellyfish,代码行数:31,代码来源:groups.php

示例9: findEmailFromBeanIds

 function findEmailFromBeanIds($beanIds, $beanType, $whereArr)
 {
     global $current_user;
     $q = '';
     $whereAdd = "";
     $relatedIDs = '';
     if ($beanIds != '') {
         foreach ($beanIds as $key => $value) {
             $beanIds[$key] = '\'' . $value . '\'';
         }
         $relatedIDs = implode(',', $beanIds);
     }
     if ($beanType == 'accounts') {
         if (isset($whereArr['first_name'])) {
             $whereArr['name'] = $whereArr['first_name'];
         }
         unset($whereArr['last_name']);
         unset($whereArr['first_name']);
     }
     foreach ($whereArr as $column => $clause) {
         if (!empty($whereAdd)) {
             $whereAdd .= " OR ";
         }
         $clause = $current_user->db->quote($clause);
         $whereAdd .= "{$column} LIKE '{$clause}%'";
     }
     $table = $beanType;
     $module = ucfirst($table);
     $class = substr($module, 0, strlen($module) - 1);
     require_once "modules/{$module}/{$class}.php";
     $person = new $class();
     if ($person->ACLAccess('list')) {
         if ($relatedIDs != '') {
             $where = "({$table}.deleted = 0 AND eabr.primary_address = 1 AND {$table}.id in ({$relatedIDs}))";
         } else {
             $where = "({$table}.deleted = 0 AND eabr.primary_address = 1)";
         }
         if (ACLController::requireOwner($module, 'list')) {
             $where = $where . " AND ({$table}.assigned_user_id = '{$current_user->id}')";
         }
         // if
         if (!empty($whereAdd)) {
             $where .= " AND ({$whereAdd})";
         }
         if ($beanType === 'accounts') {
             $t = "SELECT {$table}.id, '' first_name, {$table}.name last_name, eabr.primary_address, ea.email_address, '{$module}' module ";
         } else {
             $t = "SELECT {$table}.id, {$table}.first_name, {$table}.last_name, eabr.primary_address, ea.email_address, '{$module}' module ";
         }
         $t .= "FROM {$table} ";
         $t .= "JOIN email_addr_bean_rel eabr ON ({$table}.id = eabr.bean_id and eabr.deleted=0) ";
         $t .= "JOIN email_addresses ea ON (eabr.email_address_id = ea.id) ";
         $t .= " WHERE {$where}";
         /* BEGIN - SECURITY GROUPS */
         //this function may not even be used anymore. Seems like findEmailFromBeanIds is preferred now
         if ($person->bean_implements('ACL') && ACLController::requireSecurityGroup($module, 'list')) {
             require_once 'modules/SecurityGroups/SecurityGroup.php';
             global $current_user;
             $owner_where = $person->getOwnerWhere($current_user->id);
             $group_where = SecurityGroup::getGroupWhere($table, $module, $current_user->id);
             $t .= " AND (" . $owner_where . " or " . $group_where . ") ";
         }
         /* END - SECURITY GROUPS */
     }
     // if
     return $t;
 }
开发者ID:NALSS,项目名称:SuiteCRM,代码行数:67,代码来源:EmailUI.php

示例10: get_bean_select_array

function get_bean_select_array($add_blank = true, $bean_name, $display_columns, $where = '', $order_by = '', $blank_is_none = false)
{
    global $beanFiles;
    require_once $beanFiles[$bean_name];
    $focus = new $bean_name();
    $user_array = array();
    $key = $bean_name == 'EmailTemplate' ? $bean_name : $bean_name . $display_columns . $where . $order_by;
    $user_array = get_register_value('select_array', $key);
    if (!$user_array) {
        $db = DBManagerFactory::getInstance();
        $temp_result = array();
        $query = "SELECT {$focus->table_name}.id, {$display_columns} as display from {$focus->table_name} ";
        $query .= "where ";
        if ($where != '') {
            $query .= $where . " AND ";
        }
        $query .= " {$focus->table_name}.deleted=0";
        /* BEGIN - SECURITY GROUPS */
        global $current_user, $sugar_config;
        if ($focus->module_dir == 'Users' && !is_admin($current_user) && isset($sugar_config['securitysuite_filter_user_list']) && $sugar_config['securitysuite_filter_user_list'] == true) {
            require_once 'modules/SecurityGroups/SecurityGroup.php';
            $group_where = SecurityGroup::getGroupUsersWhere($current_user->id);
            $query .= " AND (" . $group_where . ") ";
        } else {
            if ($focus->bean_implements('ACL') && ACLController::requireSecurityGroup($focus->module_dir, 'list')) {
                require_once 'modules/SecurityGroups/SecurityGroup.php';
                $owner_where = $focus->getOwnerWhere($current_user->id);
                $group_where = SecurityGroup::getGroupWhere($focus->table_name, $focus->module_dir, $current_user->id);
                if (!empty($owner_where)) {
                    $query .= " AND (" . $owner_where . " or " . $group_where . ") ";
                } else {
                    $query .= ' AND ' . $group_where;
                }
            }
        }
        /* END - SECURITY GROUPS */
        if ($order_by != '') {
            $query .= " order by {$focus->table_name}.{$order_by}";
        }
        $GLOBALS['log']->debug("get_user_array query: {$query}");
        $result = $db->query($query, true, "Error filling in user array: ");
        if ($add_blank == true) {
            // Add in a blank row
            if ($blank_is_none == true) {
                // set 'blank row' to "--None--"
                global $app_strings;
                $temp_result[''] = $app_strings['LBL_NONE'];
            } else {
                $temp_result[''] = '';
            }
        }
        // Get the id and the name.
        while ($row = $db->fetchByAssoc($result)) {
            $temp_result[$row['id']] = $row['display'];
        }
        $user_array = $temp_result;
        set_register_value('select_array', $key, $temp_result);
    }
    return $user_array;
}
开发者ID:pikkoui,项目名称:suitecrm,代码行数:60,代码来源:utils.php

示例11: build_report_access_query

 function build_report_access_query(SugarBean $module, $alias)
 {
     $module->table_name = $alias;
     $where = '';
     if ($module->bean_implements('ACL') && ACLController::requireOwner($module->module_dir, 'list')) {
         global $current_user;
         $owner_where = $module->getOwnerWhere($current_user->id);
         $where = ' AND ' . $owner_where;
     }
     if (file_exists('modules/SecurityGroups/SecurityGroup.php')) {
         /* BEGIN - SECURITY GROUPS */
         if ($module->bean_implements('ACL') && ACLController::requireSecurityGroup($module->module_dir, 'list')) {
             require_once 'modules/SecurityGroups/SecurityGroup.php';
             global $current_user;
             $owner_where = $module->getOwnerWhere($current_user->id);
             $group_where = SecurityGroup::getGroupWhere($alias, $module->module_dir, $current_user->id);
             if (!empty($owner_where)) {
                 $where .= " AND (" . $owner_where . " or " . $group_where . ") ";
             } else {
                 $where .= ' AND ' . $group_where;
             }
         }
         /* END - SECURITY GROUPS */
     }
     return $where;
 }
开发者ID:omusico,项目名称:suitecrm-docker,代码行数:26,代码来源:AOR_Report.php

示例12: date

<?php

require_once "config.php";
require_once RESACCMAN_BASE . "/classes/Text.php";
require_once RESACCMAN_BASE . "/classes/html/GroupPermissionsForm.php";
$title = Text::getText("GroupPermissions");
if (GroupPermissionsForm::isSubmitted($_REQUEST)) {
    $g = GroupPermissionsForm::handle($_REQUEST);
    $today = date("r");
    header("Location: groupPermissions.php?id=" . $g->getId() . "&saved=" . $today);
} else {
    if (sizeof($_REQUEST['id']) > 0) {
        $g = SecurityGroup::getById($id);
    }
}
if ($g == NULL) {
    $errMsg = Text::getText("GroupNotFound") . ": '" . $id . "'";
    die($errMsg);
}
$title .= ": " . $g->getName();
$form = new GroupPermissionsForm($g);
if (strlen($_REQUEST['saved']) > 0) {
    $form->setMessage(IsatisText::getText("Saved") . ": " . $_REQUEST['saved']);
}
include "header.php";
?>
<h2><?php 
echo $title;
?>
</h2><?
$form->printContent();
开发者ID:elecnix,项目名称:resaccman,代码行数:31,代码来源:groupPermissions.php

示例13: removePermission

 function removePermission($resource, $permission) {
     SecurityGroup::requirePermission("CHANGE");
     $group_id = $this->getId();
     $resource_id = $resource->getId();
     $permission_id = $permission->getId();
     $sql = "DELETE FROM security_group_permission
         WHERE group_id = ".Database::sqlValue($group_id)."
         AND resource_id = ".Database::sqlValue($resource_id)."
         AND permission_id = ".Database::sqlValue($permission_id);
     Database::query($sql);
 }
开发者ID:elecnix,项目名称:smellyfish,代码行数:11,代码来源:SecurityGroup.php

示例14: 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>&nbsp;&nbsp;
    {$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;
    }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:101,代码来源:EditView2.php

示例15: require_once

<? require_once("config.php"); ?>
<? require_once(RESACCMAN_BASE."/classes/SecurityGroup.php"); ?>
<? require_once(RESACCMAN_BASE."/classes/Text.php"); ?>
<?

$g = new SecurityGroup();
$g->setName($name);

if ($action == "save") {
    if (strlen($name) > 0) {
        $g->save();
        header("Location: groups.php");
    } else {
        $errMsg = Text::getText("MissingGroupName");
        $buttonCaption = Text::getText("Save");
        include("header.php");
        include("groupEditForm.php");
        include("footer.php");
    }
} else {
    $title = Text::getText("EditGroup");
    $buttonCaption = Text::getText("Save");
    include("header.php");
    include("groupEditForm.php");
    include("footer.php");
}
?>
开发者ID:elecnix,项目名称:resaccman,代码行数:27,代码来源:groupAdd.php


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