From: <aga...@us...> - 2014-08-11 14:12:35
|
Revision: 6807 http://sourceforge.net/p/web-erp/reponame/6807 Author: agaluski Date: 2014-08-11 14:12:30 +0000 (Mon, 11 Aug 2014) Log Message: ----------- Authorize user for default location on create (Tim) Modified Paths: -------------- trunk/WWW_Users.php Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2014-08-09 04:37:02 UTC (rev 6806) +++ trunk/WWW_Users.php 2014-08-11 14:12:30 UTC (rev 6807) @@ -87,7 +87,7 @@ prnMsg(_('The demonstration user called demo cannot be modified.'),'error'); $InputError = 1; } - + if (!isset($SelectedUser)){ /* check to ensure the user id is not already entered */ $result = DB_query("SELECT userid FROM www_users WHERE userid='" . $_POST['UserID'] . "'",$db); @@ -163,6 +163,20 @@ prnMsg( _('The selected user record has been updated'), 'success' ); } elseif ($InputError !=1) { + $LocationSql = "INSERT INTO locationusers (loccode, + userid, + canview, + canupd + ) VALUES ( + '" . $_POST['DefaultLocation'] . "', + '" . $_POST['UserID'] . "', + 1, + 1 + )"; + $ErrMsg = _('The default user locations could not be processed because'); + $DbgMsg = _('The SQL that was used to update the user locations and failed was'); + $Result = DB_query($LocationSql, $ErrMsg, $DbgMsg); + $sql = "INSERT INTO www_users (userid, realname, customerid, |