[Vtigercrm-commits] [vtiger-commits] r6365 - in /vtigercrm/trunk: data/SugarBean.php modules/Users/EditView.php modules/Users/Save.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Wed May 24 14:24:29 EDT 2006
Author: allanbush
Date: Wed May 24 12:24:26 2006
New Revision: 6365
Log:
Fixes so we can add users without errors.
Modified:
vtigercrm/trunk/data/SugarBean.php
vtigercrm/trunk/modules/Users/EditView.php
vtigercrm/trunk/modules/Users/Save.php
Modified: vtigercrm/trunk/data/SugarBean.php
==============================================================================
--- vtigercrm/trunk/data/SugarBean.php (original)
+++ vtigercrm/trunk/data/SugarBean.php Wed May 24 12:24:26 2006
@@ -171,6 +171,9 @@
if ($id == -1) {
$id = $this->id;
}
+ if($id == '') {
+ return null;
+ }
// GS porting crmentity
$query = "SELECT * FROM $this->table_name WHERE $this->module_id = '$id'";
// $query = "SELECT * FROM $this->table_name WHERE ID = '$id'";
Modified: vtigercrm/trunk/modules/Users/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Users/EditView.php (original)
+++ vtigercrm/trunk/modules/Users/EditView.php Wed May 24 12:24:26 2006
@@ -208,11 +208,17 @@
if (is_admin($current_user)) {
$GROUP_SELECT_OPTION = '<select name="group_name">';
$GROUP_SELECT_OPTION .= '<option value="">--None--</option>';
- $sql = "select groupname from users2group inner join groups on groups.groupid=users2group.groupid where userid='" .$focus->id ."'";
- $result = $adb->query($sql);
- $groupnameArray = $adb->fetch_array($result);
+ if($focus->id) {
+ $sql = "SELECT groupname
+ FROM users2group
+ INNER JOIN groups
+ ON groups.groupid = users2group.groupid
+ WHERE userid = '" .$focus->id ."'";
+ $result = $adb->query($sql);
+ $groupnameArray = $adb->fetch_array($result);
+ }
$groupselected = $groupnameArray["groupname"];
- $sql2 = "select groupname from groups";
+ $sql2 = "SELECT groupname FROM groups";
$result_name = $adb->query($sql2);
$temprow = $adb->fetch_array($result_name);
do
Modified: vtigercrm/trunk/modules/Users/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Users/Save.php (original)
+++ vtigercrm/trunk/modules/Users/Save.php Wed May 24 12:24:26 2006
@@ -29,7 +29,7 @@
$user_name = $_REQUEST['userName'];
if(isset($_REQUEST['dup_check']) && $_REQUEST['dup_check'] != '')
{
- $query = 'Select user_name from users where user_name ="'.$user_name.'"';
+ $query = "SELECT user_name FROM users WHERE user_name ='".$user_name."'";
$result = $adb->query($query);
if($adb->num_rows($result) > 0)
{
More information about the vtigercrm-commits
mailing list