[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/Users/ -> SaveRole.php (source)

   1  <?php
   2  /*********************************************************************************
   3  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
   4   * ("License"); You may not use this file except in compliance with the License
   5   * The Original Code is:  vtiger CRM Open Source
   6   * The Initial Developer of the Original Code is vtiger.
   7   * Portions created by vtiger are Copyright (C) vtiger.
   8   * All Rights Reserved.
   9  *
  10   ********************************************************************************/
  11  
  12  require_once ('include/database/PearDatabase.php');
  13  global $adb;
  14  $rolename = $_REQUEST['roleName'];
  15  $mode = $_REQUEST['mode'];
  16  if(isset($_REQUEST['dup_check']) && $_REQUEST['dup_check']!='')
  17  {
  18      if($mode != 'edit')
  19      {
  20          $query = 'select rolename from vtiger_role where rolename="'.$rolename.'"';
  21      }
  22      else
  23      {
  24          $roleid=$_REQUEST['roleid'];
  25          $query = 'select rolename from vtiger_role where rolename="'.$rolename.'" and roleid !="'.$roleid.'"';
  26  
  27      }
  28      $result = $adb->query($query);
  29      if($adb->num_rows($result) > 0)
  30      {
  31          echo 'Role name already exists';
  32          die;
  33      }else
  34      {
  35          echo 'SUCESS';
  36          die;
  37      }
  38  
  39  }
  40  $parentRoleId=$_REQUEST['parent'];
  41  //Inserting values into Role Table
  42  if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'edit')
  43  {
  44      $roleId = $_REQUEST['roleid'];
  45      $selected_col_string =     $_REQUEST['selectedColumnsString'];
  46      $profile_array = explode(';',$selected_col_string);
  47      updateRole($roleId,$rolename,$profile_array);
  48          
  49  }
  50  elseif(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'create')
  51  {
  52      $selected_col_string =     $_REQUEST['selectedColumnsString'];
  53      $profile_array = explode(';',$selected_col_string);
  54      //Inserting into vtiger_role Table
  55      $roleId = createRole($rolename,$parentRoleId,$profile_array);
  56           
  57  }
  58  
  59  $loc = "Location: index.php?action=listroles&module=Users&parenttab=Settings";
  60  header($loc);
  61  ?>


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7