From: <tim...@us...> - 2010-01-15 16:36:30
|
Revision: 3299 http://web-erp.svn.sourceforge.net/web-erp/?rev=3299&view=rev Author: tim_schofield Date: 2010-01-15 16:36:23 +0000 (Fri, 15 Jan 2010) Log Message: ----------- The userid session variable was not being correctly set. Modified Paths: -------------- trunk/doc/Change.log.html trunk/includes/UserLogin.php Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-13 14:16:22 UTC (rev 3298) +++ trunk/doc/Change.log.html 2010-01-15 16:36:23 UTC (rev 3299) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>15/01/10 Tim: UserLogin.php: The userid session variable was not being correctly set.</p> <p>13/01/10 Tim: api_xml-rpc.php: Use output buffering to hide html error messages so that the api can handle errors in a graceful way</p> <p>13/01/10 Tim: PO_Header.php: Show the mailto links correctly by decoding the hml entities</p> <p>13/01/10 Lindsay: api_login.php, api_xml-rpc.php: Added logout method to API.</p> @@ -9,7 +10,7 @@ <p>12/01/10 Tim: Z_ChangeStockCode.php - Check thast mrpplannedorders table exists before trying to alter it</p> <p>10/01/10 Tim: StockTransfers.php - Correctly show stockid in links to ther functions.</p> <p>10/01/10 Bryan Nielsen: BOMs.php - syntax error includes() was used not include()</p> -<p>09/01/10 Phil: Fix price for same item on an order priced at different prices - unfortunately, this means that there may be rounding errors on very large currencies as I reverted to the old logic using the stockmoves which use local currency and then converting back to the currency of the invoice - fixed both portrait and landscape +<p>09/01/10 Phil: Fix price for same item on an order priced at different prices - unfortunately, this means that there may be rounding errors on very large currencies as I reverted to the old logic using the stockmoves which use local currency and then converting back to the currency of the invoice - fixed both portrait and landscape</p> <p>09/01/10 Lindsay: Changes to api session handling. <p>08/01/10 Tim: PrintCustTrans.php - Correct errors preventing invoice from printing <p>08/01/10 Tim: Put a supplier invoice on hold when outside the bounds set up in the config Modified: trunk/includes/UserLogin.php =================================================================== --- trunk/includes/UserLogin.php 2010-01-13 14:16:22 UTC (rev 3298) +++ trunk/includes/UserLogin.php 2010-01-15 16:36:23 UTC (rev 3299) @@ -55,29 +55,30 @@ $Auth_Result = DB_query($sql, $db); // Populate session variables with data base results if (DB_num_rows($Auth_Result) > 0) { - $myrow = DB_fetch_row($Auth_Result); + $myrow = DB_fetch_array($Auth_Result); if ($myrow[7]==1){ //the account is blocked return UL_BLOCKED; } /*reset the attempts counter on successful login */ $_SESSION['AttemptsCounter'] = 0; - $_SESSION['AccessLevel'] = $myrow[0]; - $_SESSION['CustomerID'] = $myrow[1]; - $_SESSION['UserBranch'] = $myrow[5]; - $_SESSION['DefaultPageSize'] = $myrow[3]; - $_SESSION['UserStockLocation'] = $myrow[4]; - $_SESSION['ModulesEnabled'] = explode(",", $myrow[6]); - $_SESSION['UsersRealName'] = $myrow[8]; - $_SESSION['Theme'] = $myrow[9]; + $_SESSION['AccessLevel'] = $myrow['fullaccess']; + $_SESSION['CustomerID'] = $myrow['customerid']; + $_SESSION['UserBranch'] = $myrow['branchcode']; + $_SESSION['DefaultPageSize'] = $myrow['pagesize']; + $_SESSION['UserStockLocation'] = $myrow['defaultlocation']; + $_SESSION['ModulesEnabled'] = explode(",", $myrow['modulesallowed']); + $_SESSION['UsersRealName'] = $myrow['realname']; + $_SESSION['Theme'] = $myrow['theme']; // $_SESSION['UserID'] = $myrow[11]; - $_SESSION['Language'] = $myrow[12]; - $_SESSION['SalesmanLogin'] = $myrow[13]; + $_SESSION['Language'] = $myrow['language']; + $_SESSION['SalesmanLogin'] = $myrow['salesman']; if ($myrow[10] > 0) { - $_SESSION['DisplayRecordsMax'] = $myrow[10]; + $_SESSION['DisplayRecordsMax'] = $myrow['displayrecordsmax']; } else { $_SESSION['DisplayRecordsMax'] = $_SESSION['DefaultDisplayRecordsMax']; // default comes from config.php } + $_SESSION['UserID'] = $myrow['userid']; $sql = "UPDATE www_users SET lastvisitdate='". date("Y-m-d H:i:s") ."' WHERE www_users.userid='" . $Name . "'"; $Auth_Result = DB_query($sql, $db); @@ -96,7 +97,6 @@ } } // Temporary shift - disable log messages. - $_SESSION['UserID'] = $myrow[11]; } else { // Incorrect password // 5 login attempts, show failed login screen if (!isset($_SESSION['AttemptsCounter'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |