• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP SecurityGroup类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: getGroupLayouts

 function getGroupLayouts()
 {
     $views = $this->getViews();
     //$defaultLayout [] = array ( 'name' => translate('LBL_DEFAULT') , 'type' => 'Folder' , 'children' => $layouts , 'action' => 'module=ModuleBuilder&action=wizard&layouts=1&view_module=' . $this->module ) ;
     //$layout_nodes[] = array ( 'name' => translate($groupFocus->name) , 'type' => 'Folder' , 'children' => $group_layouts , 'action' => 'module=ModuleBuilder&action=wizard&layouts=1&view_module=' . $this->module . "&grpLayout=".$groupFocus->id ) ;
     //translate('LBL_LAYOUTS') => array ( 'children' => 'getLayouts' , 'action' => "module=ModuleBuilder&action=wizard&view=layouts&view_module={$this->module}" , 'imageTitle' => 'Layouts' , 'help' => 'layoutsBtn' ) ,
     $defaultLayout[] = array('name' => translate('LBL_DEFAULT'), 'type' => 'Folder', 'children' => $this->getLayouts(), 'action' => "module=ModuleBuilder&action=wizard&view=layouts&view_module={$this->module}", 'imageTitle' => 'Layouts', 'help' => 'layoutsBtn');
     $layout_nodes = array();
     $layout_nodes = $defaultLayout;
     //get security group nodes...in metadata directory in a folder named with the guid of the security group
     $custDirectory = "custom/modules/" . $this->module . "/metadata/";
     if (is_dir($custDirectory)) {
         require_once 'modules/SecurityGroups/SecurityGroup.php';
         $groupFocus = new SecurityGroup();
         $d = dir($custDirectory);
         while ($f = $d->read()) {
             if ($f == "." || $f == "..") {
                 continue;
             }
             if (is_dir("{$custDirectory}/{$f}")) {
                 //see if $f is a guid for a security group
                 $groupFocus = new SecurityGroup();
                 $groupFocus->retrieve($f);
                 if (!empty($groupFocus->id) && isset($groupFocus->id)) {
                     //found existing group layout...create node
                     $GLOBALS['log']->debug("Found Security Group Layout for: " . $groupFocus->name);
                     $group_layouts = array();
                     //remove group layout option
                     $group_layouts[] = array('name' => translate('LBL_REMOVE_LAYOUT'), 'action' => "module=ModuleBuilder&action=removeGroupLayoutPrompt&view_module={$this->module}" . "&grpLayout=" . $groupFocus->id);
                     foreach ($views as $def) {
                         $group_layouts[$def['name']] = array('name' => $def['name'], 'action' => "module=ModuleBuilder&action=editLayout&view={$def['type']}&view_module={$this->module}&grpLayout=" . $groupFocus->id, 'imageTitle' => $def['image'], 'help' => "viewBtn{$def['type']}", 'size' => '48');
                     }
                     if ($this->isValidDashletModule($this->module)) {
                         $dashlets = array();
                         $dashlets[] = array('name' => translate('LBL_DASHLETLISTVIEW'), 'type' => 'dashlet', 'action' => 'module=ModuleBuilder&action=editLayout&view=dashlet&view_module=' . $this->module . "&grpLayout=" . $groupFocus->id);
                         $dashlets[] = array('name' => translate('LBL_DASHLETSEARCHVIEW'), 'type' => 'dashletsearch', 'action' => 'module=ModuleBuilder&action=editLayout&view=dashletsearch&view_module=' . $this->module . "&grpLayout=" . $groupFocus->id);
                         $group_layouts[translate('LBL_DASHLET')] = array('name' => translate('LBL_DASHLET'), 'type' => 'Folder', 'children' => $dashlets, 'imageTitle' => 'Dashlet', 'action' => 'module=ModuleBuilder&action=wizard&view=dashlet&view_module=' . $this->module . "&grpLayout=" . $groupFocus->id);
                     }
                     //For popup tree node
                     $popups = array();
                     $popups[] = array('name' => translate('LBL_POPUPLISTVIEW'), 'type' => 'popuplistview', 'action' => 'module=ModuleBuilder&action=editLayout&view=popuplist&view_module=' . $this->module . "&grpLayout=" . $groupFocus->id);
                     $popups[] = array('name' => translate('LBL_POPUPSEARCH'), 'type' => 'popupsearch', 'action' => 'module=ModuleBuilder&action=editLayout&view=popupsearch&view_module=' . $this->module . "&grpLayout=" . $groupFocus->id);
                     $group_layouts[translate('LBL_POPUP')] = array('name' => translate('LBL_POPUP'), 'type' => 'Folder', 'children' => $popups, 'imageTitle' => 'Popup', 'imageName' => 'icon_Popup.gif', 'action' => 'module=ModuleBuilder&action=wizard&view=popup&view_module=' . $this->module . "&grpLayout=" . $groupFocus->id);
                     $nodes = $this->getSearch($groupFocus->id);
                     if (!empty($nodes)) {
                         $group_layouts[translate('LBL_SEARCH')] = array('name' => translate('LBL_SEARCH'), 'type' => 'Folder', 'children' => $nodes, 'action' => "module=ModuleBuilder&action=wizard&view=search&view_module={$this->module}&grpLayout=" . $groupFocus->id, 'imageTitle' => 'SearchForm', 'help' => 'searchBtn', 'size' => '48');
                     }
                     $layout_nodes[] = array('name' => translate($groupFocus->name), 'type' => 'Folder', 'children' => $group_layouts, 'action' => 'module=ModuleBuilder&action=wizard&&view=layouts&view_module=' . $this->module . "&grpLayout=" . $groupFocus->id);
                 }
             }
         }
         //end while files/dirs
     }
     //end if directory exists
     //$layouts [ translate('LBL_LAYOUTS') ] = array ( 'name' => translate('LBL_LAYOUTS') , 'type' => 'Folder' , 'children' => $layout_nodes , 'action' => "module=ModuleBuilder&action=addlayout&layouts=1&view_module={$this->module}") ;
     //$nodes [ 'children' ] [] = array ( 'name' => translate('LBL_LAYOUTS') , 'type' => 'Folder' , 'children' => $layout_nodes , 'action' => 'module=ModuleBuilder&action=addlayout&layouts=1&view_module=' . $this->module ) ;
     return $layout_nodes;
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:58,代码来源:StudioModule.php


示例17: process_dynamic_listview_rows


//.........这里部分代码省略.........
             $BG_COLOR = $even_bg;
         }
         $oddRow = !$oddRow;
         $button_contents = array();
         $this->xTemplate->assign("ROW_COLOR", $ROW_COLOR);
         $this->xTemplate->assign("BG_COLOR", $BG_COLOR);
         $layout_manager = $this->getLayoutManager();
         $layout_manager->setAttribute('context', 'List');
         $layout_manager->setAttribute('image_path', $this->local_image_path);
         $layout_manager->setAttribute('module_name', $subpanel_def->_instance_properties['module']);
         if (!empty($this->child_focus)) {
             $layout_manager->setAttribute('related_module_name', $this->child_focus->module_dir);
         }
         //AG$subpanel_data = $this->list_field_defs;
         //$bla = array_pop($subpanel_data);
         //select which sub-panel to display here, the decision will be made based on the type of
         //the sub-panel and panel in the bean being processed.
         if ($subpanel_def->isCollection()) {
             $thepanel = $subpanel_def->sub_subpanels[$aItem->panel_name];
         } else {
             $thepanel = $subpanel_def;
         }
         /* BEGIN - SECURITY GROUPS */
         //This check is costly doing it field by field in the below foreach
         //instead pull up here and do once per record....
         $aclaccess_is_owner = false;
         $aclaccess_in_group = false;
         global $current_user;
         if (is_admin($current_user 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP SecurityTestHelper类代码示例发布时间:2022-05-23
下一篇:
PHP Security类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap