phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] admin/inc class.bocategories.inc.php class.soac... [V


From: Dave Hall
Subject: [Phpgroupware-cvs] admin/inc class.bocategories.inc.php class.soac... [Version-0_9_16-branch]
Date: Mon, 24 Apr 2006 15:35:29 +0000

CVSROOT:        /sources/phpgroupware
Module name:    admin
Branch:         Version-0_9_16-branch
Changes by:     Dave Hall <address@hidden>      06/04/24 15:35:29

Modified files:
        inc            : class.bocategories.inc.php 
                         class.soaccess_history.inc.php 
                         class.soapplications.inc.php 
                         class.solog.inc.php 

Log message:
        minor cleanups

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/admin/inc/class.bocategories.inc.php.diff?only_with_tag=Version-0_9_16-branch&tr1=1.3.2.3.2.3&tr2=1.3.2.3.2.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/admin/inc/class.soaccess_history.inc.php.diff?only_with_tag=Version-0_9_16-branch&tr1=1.3.4.4&tr2=1.3.4.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/admin/inc/class.soapplications.inc.php.diff?only_with_tag=Version-0_9_16-branch&tr1=1.4.2.1.2.2&tr2=1.4.2.1.2.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/admin/inc/class.solog.inc.php.diff?only_with_tag=Version-0_9_16-branch&tr1=1.5.2.1.2.1&tr2=1.5.2.1.2.2&r1=text&r2=text

Patches:
Index: admin/inc/class.bocategories.inc.php
diff -u admin/inc/class.bocategories.inc.php:1.3.2.3.2.3 
admin/inc/class.bocategories.inc.php:1.3.2.3.2.4
--- admin/inc/class.bocategories.inc.php:1.3.2.3.2.3    Sat Nov  6 16:13:47 2004
+++ admin/inc/class.bocategories.inc.php        Mon Apr 24 15:35:29 2006
@@ -9,7 +9,7 @@
        *  Free Software Foundation; either version 2 of the License, or (at 
your  *
        *  option) any later version.                                           
   *
        
\**************************************************************************/
-       /* $Id: class.bocategories.inc.php,v 1.3.2.3.2.3 2004/11/06 16:13:47 
powerstat Exp $ */
+       /* $Id: class.bocategories.inc.php,v 1.3.2.3.2.4 2006/04/24 15:35:29 
skwashd Exp $ */
        /* $Source: 
/sources/phpgroupware/admin/inc/class.bocategories.inc.php,v $ */
 
        class bocategories
@@ -43,9 +43,9 @@
                        /* Might change this to '' at the end---> */
                        $start  = get_var('start',array('POST','GET'));
                        $query  = get_var('query',array('POST','GET'));
-                       $sort   = get_var('sort', array('POST','GET'));
+                       $sort   = $_REQUEST['sort'] == 'DESC' ? 'DESC' : 'ASC';
                        $order  = get_var('order',array('POST','GET'));
-                       $cat_id = get_var('cat_id',array('POST','GET'));
+                       $cat_id = (int) get_var('cat_id',array('POST','GET'));
 
                        if(!empty($start) || $start == '0' || $start == 0)
                        {
Index: admin/inc/class.soaccess_history.inc.php
diff -u admin/inc/class.soaccess_history.inc.php:1.3.4.4 
admin/inc/class.soaccess_history.inc.php:1.3.4.5
--- admin/inc/class.soaccess_history.inc.php:1.3.4.4    Fri Sep 30 09:53:43 2005
+++ admin/inc/class.soaccess_history.inc.php    Mon Apr 24 15:35:29 2006
@@ -9,7 +9,7 @@
        *  option) any later version.                                           
   *
        
\**************************************************************************/
 
-       /* $Id: class.soaccess_history.inc.php,v 1.3.4.4 2005/09/30 09:53:43 
Caeies Exp $ */
+       /* $Id: class.soaccess_history.inc.php,v 1.3.4.5 2006/04/24 15:35:29 
skwashd Exp $ */
 
        class soaccess_history
        {
@@ -17,14 +17,15 @@
 
                function soaccess_history()
                {
-                       $this->db       = $GLOBALS['phpgw']->db;
+                       $this->db =& $GLOBALS['phpgw']->db;
                }
 
                function test_account_id($account_id)
                {
+                       $account_id = (int)$account_id;
                        if ($account_id)
                        {
-                               return ' WHERE account_id=' . 
intval($account_id);
+                               return " WHERE account_id = $account_id";
                        }
                }
 
Index: admin/inc/class.soapplications.inc.php
diff -u admin/inc/class.soapplications.inc.php:1.4.2.1.2.2 
admin/inc/class.soapplications.inc.php:1.4.2.1.2.3
--- admin/inc/class.soapplications.inc.php:1.4.2.1.2.2  Sun Apr 25 21:28:14 2004
+++ admin/inc/class.soapplications.inc.php      Mon Apr 24 15:35:29 2006
@@ -9,7 +9,7 @@
   *  option) any later version.                                              *
   \**************************************************************************/
 
-  /* $Id: class.soapplications.inc.php,v 1.4.2.1.2.2 2004/04/25 21:28:14 jengo 
Exp $ */
+  /* $Id: class.soapplications.inc.php,v 1.4.2.1.2.3 2006/04/24 15:35:29 
skwashd Exp $ */
 
        class soapplications
        {
@@ -17,7 +17,7 @@
 
                function soapplications()
                {
-                       $this->db = $GLOBALS['phpgw']->db;
+                       $this->db =& $GLOBALS['phpgw']->db;
                }
 
                function read($app_name)
@@ -63,34 +63,31 @@
                        $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();
                        $app_id = $this->db->f(0) + 1;
-                       $sql = 'INSERT INTO phpgw_applications 
(app_id,app_name,app_enabled,app_order) VALUES('
-                               . $app_id . ",'" . 
addslashes($data['n_app_name']) . "','"
-                               . $data['n_app_status'] . "','" . 
$data['app_order'] . "')";
+                       $sql = 'INSERT INTO phpgw_applications (app_id, 
app_name, app_enabled, app_order) ' .
+                                       "VALUES($app_id, '" . 
$this->db->db_addslashes($data['n_app_name']) . "'," .
+                                       (int)$data['n_app_status'] . ',' . 
(int)$data['app_order'] . ')';
 
                        $this->db->query($sql,__LINE__,__FILE__);
-                       return True;
+                       return true;
                }
 
                function save($data)
                {
-                       $sql = "UPDATE phpgw_applications SET app_name='" . 
addslashes($data['n_app_name']) . "',"
-                               . "app_enabled='" . $data['n_app_status'] . 
"',app_order='" . $data['app_order'] 
-                               . "' WHERE app_name='" . $data['old_app_name'] 
. "'";
+                       $sql = "UPDATE phpgw_applications SET app_name='" . 
$this->db->db_addslashes($data['n_app_name']) . "',"
+                               . "app_enabled=" . (int)$data['n_app_status'] . 
", app_order=" . (int)$data['app_order'] 
+                               . " WHERE app_name='" . 
$this->db->db_addslashes($data['old_app_name']) . "'";
 
                        $this->db->query($sql,__LINE__,__FILE__);
-                       return True;
+                       return true;
                }
 
                function exists($app_name)
                {
-                       $this->db->query("SELECT COUNT(app_name) FROM 
phpgw_applications WHERE app_name='" . addslashes($app_name) . 
"'",__LINE__,__FILE__);
+                       $app_name = $this->db->db_addslashes($app_name);
+                       $this->db->query("SELECT COUNT(app_name) FROM 
phpgw_applications WHERE app_name='$app_name'",__LINE__,__FILE__);
                        $this->db->next_record();
 
-                       if ($this->db->f(0) != 0)
-                       {
-                               return True;
-                       }
-                       return False;
+                       return !!$this->db->f(0);
                }
 
                function app_order()
@@ -102,6 +99,7 @@
 
                function delete($app_name)
                {
+                       $app_name = $this->db->db_addslashes($app_name);
                        $this->db->query("DELETE FROM phpgw_applications WHERE 
app_name='$app_name'",__LINE__,__FILE__);
                }
 
Index: admin/inc/class.solog.inc.php
diff -u admin/inc/class.solog.inc.php:1.5.2.1.2.1 
admin/inc/class.solog.inc.php:1.5.2.1.2.2
--- admin/inc/class.solog.inc.php:1.5.2.1.2.1   Sun Oct 19 01:34:02 2003
+++ admin/inc/class.solog.inc.php       Mon Apr 24 15:35:29 2006
@@ -9,7 +9,7 @@
        *  option) any later version.                                           
   *
        
\**************************************************************************/
 
-       /* $Id: class.solog.inc.php,v 1.5.2.1.2.1 2003/10/19 01:34:02 cw Exp $ 
*/
+       /* $Id: class.solog.inc.php,v 1.5.2.1.2.2 2006/04/24 15:35:29 skwashd 
Exp $ */
 
        class solog
        {
@@ -17,21 +17,21 @@
 
                function solog()
                {
-                       $this->db       = $GLOBALS['phpgw']->db;
+                       $this->db =& $GLOBALS['phpgw']->db;
                }
 
                function test_account_id($account_id)
                {
-                       if ($account_id)
+                       $account_id = (int) $account_id;
+                       if ($account_id > 0)
                        {
-                               return " where log_account_id='$account_id'";
+                               return " where log_account_id = $account_id";
                        }
                }
 
                function list_log($account_id,$start,$order,$sort)
                {
                        $where = $this->test_account_id($account_id);
-
                        $this->db->limit_query("select 
log_date,log_account_lid,log_app,log_severity,log_file,log_line,log_msg from 
phpgw_log $where order by log_id desc",$start,__LINE__,__FILE__);
                        while ($this->db->next_record())
                        {
@@ -62,7 +62,7 @@
                {
                        $where = $this->test_account_id($account_id);
 
-                       $db = $GLOBALS['phpgw']->db;
+                       $db =& $GLOBALS['phpgw']->db;
                        $db->query("delete from phpgw_log 
$where",__LINE__,__FILE__);
                        if ( $db->Errno ) {
                                log_error(array('text' => 'Failed to delete log 
records from database using where clause of %1. DB errno %2: message %3',




reply via email to

[Prev in Thread] Current Thread [Next in Thread]