phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] sitemgr/inc/class.Sites_SO.inc.php, 1.3


From: nomail
Subject: [Phpgroupware-cvs] sitemgr/inc/class.Sites_SO.inc.php, 1.3
Date: Wed, 21 Jul 2004 01:22:53 +0200

Update of /sitemgr/inc
Modified Files:
        Branch: 
          class.Sites_SO.inc.php

date: 2004/07/20 23:22:53;  author: skwashd;  state: Exp;  lines: +14 -11

Log Message:
merge from 16
=====================================================================
Index: sitemgr/inc/class.Sites_SO.inc.php
diff -u sitemgr/inc/class.Sites_SO.inc.php:1.2 
sitemgr/inc/class.Sites_SO.inc.php:1.3
--- sitemgr/inc/class.Sites_SO.inc.php:1.2      Fri May 30 04:01:43 2003
+++ sitemgr/inc/class.Sites_SO.inc.php  Tue Jul 20 23:22:53 2004
@@ -11,8 +11,8 @@
                function list_siteids()
                {
                        $result = array();
-                       $sql = "SELECT site_id FROM phpgw_sitemgr_sites";
-                       $this->db->query($sql,__LINE__,__FILE__);
+                       
+                       $this->db->query('SELECT site_id FROM 
phpgw_sitemgr_sites', __LINE__, __FILE__);
                        while ($this->db->next_record())
                        {
                                $result[] = $this->db->f('site_id');
@@ -30,13 +30,15 @@
                                }
                                if ($query)
                                {
+                                       $query = 
$this->db->db_addslashes($query);
                                        $whereclause = "WHERE site_name LIKE 
'%$query%'"
                                                . "OR site_url LIKE '%$query%'"
                                                . "OR site_dir LIKE '%$query%'";
                                }
                                if ($order)
                                {
-                                       $orderclause = 'ORDER BY ' . $order . ' 
' . $sort;
+                                       $orderclause = 'ORDER BY ' . 
$this->db->db_addslashes($order) 
+                                                       . ' ' . 
$this->db->db_addslashes($sort);
                                }
                                else
                                {
@@ -49,8 +51,7 @@
                        }
                        else
                        {
-                               $sql = "SELECT site_id,site_name,site_url from 
phpgw_sitemgr_sites";
-                               $this->db->query($sql,__LINE__,__FILE__);
+                               $this->db->query('SELECT 
site_id,site_name,site_url FROM phpgw_sitemgr_sites', __LINE__, __FILE__);
                        }
                        while ($this->db->next_record())
                        {
@@ -65,15 +66,15 @@
 
                function getnumberofsites()
                {
-                       $sql = "SELECT COUNT(*) FROM phpgw_sitemgr_sites";
-                       $this->db->query($sql,__LINE__,__FILE__);
+                       $this->db->query('SELECT COUNT(*) FROM 
phpgw_sitemgr_sites',__LINE__,__FILE__);
                        $this->db->next_record();
                        return $this->db->f(0);
                }
 
                function urltoid($url)
                {
-                       $sql = "SELECT site_id FROM phpgw_sitemgr_sites WHERE 
site_url = '$url'";
+                       $sql  = 'SELECT site_id FROM phpgw_sitemgr_sites ';
+                       $sql .= "WHERE site_url ='" . 
$this->db->db_addslashes($url) . "'";
                        $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();
                        return $this->db->f('site_id');
@@ -81,7 +82,8 @@
 
                function read($id)
                {
-                       $sql = "SELECT * from phpgw_sitemgr_sites WHERE site_id 
= $id";
+                       $sql =  'SELECT * FROM phpgw_sitemgr_sites ';
+                       $sql .= 'WHERE site_id = ' . intval($id);
                        $this->db->query($sql,__LINE__,__FILE__);
                        if ($this->db->next_record())
                        {
@@ -104,7 +106,8 @@
 
                function read2($id)
                {
-                       $sql = "SELECT site_url,site_dir from 
phpgw_sitemgr_sites WHERE site_id = $id";
+                       $sql  = 'SELECT site_url,site_dir FROM 
phpgw_sitemgr_sites ';
+                       $sql .= 'WHERE site_id = ' . intval($id);
                        $this->db->query($sql,__LINE__,__FILE__);
                        if ($this->db->next_record())
                        {
@@ -163,4 +166,4 @@
                                "', home_page_id = " . $prefs['home_page_id'] . 
" WHERE site_id = " . CURRENT_SITE_ID;
                        $this->db->query($sql,__LINE__,__FILE__);
                }
-       }
\ No newline at end of file
+       }




reply via email to

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