[Vtigercrm-commits] [vtiger-commits] r6103 - /vtigercrm/trunk/modules/Users/SaveRole.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Wed May 17 05:48:01 EDT 2006
Author: don
Date: Wed May 17 03:47:57 2006
New Revision: 6103
Log:
Duplicate check for Roles done
Modified:
vtigercrm/trunk/modules/Users/SaveRole.php
Modified: vtigercrm/trunk/modules/Users/SaveRole.php
==============================================================================
--- vtigercrm/trunk/modules/Users/SaveRole.php (original)
+++ vtigercrm/trunk/modules/Users/SaveRole.php Wed May 17 03:47:57 2006
@@ -11,10 +11,22 @@
require_once('include/database/PearDatabase.php');
global $adb;
-
$rolename = $_REQUEST['roleName'];
+if(isset($_REQUEST['dup_check']) && $_REQUEST['dup_check']!='')
+{
+ $query = 'select rolename from role where rolename="'.$rolename.'"';
+ $result = $adb->query($query);
+ if($adb->num_rows($result) > 0)
+ {
+ echo 'Role name already exists';
+ die;
+ }else
+ {
+ echo 'SUCESS';
+ die;
+ }
+}
$parentRoleId=$_REQUEST['parent'];
-
//Inserting values into Role Table
if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'edit')
{
More information about the vtigercrm-commits
mailing list