phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: sitemgr/inc class.ACL_SO.inc.php,1.1.1.1,1.2 cla


From: Patrick Walsh <address@hidden>
Subject: [Phpgroupware-cvs] CVS: sitemgr/inc class.ACL_SO.inc.php,1.1.1.1,1.2 class.Categories_db_SO.inc.php,1.6,1.7 class.MainMenu_UI.inc.php,1.2,1.3 class.Pages_SO.inc.php,1.6,1.7 class.contributor_ManagePage_UI.inc.php,1.6,1.7 class.sitePreference_SO.inc.php,1.1.1.1,1.2
Date: Wed, 11 Sep 2002 18:39:30 -0400

Update of /cvsroot/phpgroupware/sitemgr/inc
In directory subversions:/tmp/cvs-serv17296

Modified Files:
        class.ACL_SO.inc.php class.Categories_db_SO.inc.php 
        class.MainMenu_UI.inc.php class.Pages_SO.inc.php 
        class.contributor_ManagePage_UI.inc.php 
        class.sitePreference_SO.inc.php 
Log Message:
Fixed the database classes to be pgsql compatible


Index: class.ACL_SO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.ACL_SO.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.ACL_SO.inc.php        29 Aug 2002 03:03:17 -0000      1.1.1.1
--- class.ACL_SO.inc.php        11 Sep 2002 22:39:28 -0000      1.2
***************
*** 16,21 ****
        {
                $memberships = 
$this->acct->membership($this->acl->logged_in_user);
!               $sql = 'SELECT acl_rights FROM phpgw_acl WHERE 
acl_location="'.$location.
!                       '" and acl_account in 
('.$GLOBALS['phpgw_info']['user']['account_id'];
                if (is_array($memberships))
                {
--- 16,21 ----
        {
                $memberships = 
$this->acct->membership($this->acl->logged_in_user);
!               $sql = 'SELECT acl_rights FROM phpgw_acl WHERE 
acl_location=\''.$location.
!                       '\' and acl_account in 
('.$GLOBALS['phpgw_info']['user']['account_id'];
                if (is_array($memberships))
                {
***************
*** 37,41 ****
        function get_rights($account_id, $location)
        {
!               $sql = 'select acl_rights from phpgw_acl where 
acl_appname="sitemgr" and acl_location="'.$location.'" and 
acl_account="'.$account_id.'"';
                $this->db->query($sql,__LINE__,__FILE__);
                if ($this->db->next_record())
--- 37,41 ----
        function get_rights($account_id, $location)
        {
!               $sql = 'select acl_rights from phpgw_acl where 
acl_appname=\'sitemgr\' and acl_location=\''.$location.'\' and 
acl_account=\''.$account_id.'\'';
                $this->db->query($sql,__LINE__,__FILE__);
                if ($this->db->next_record())
***************
*** 51,56 ****
        function remove_location($location)
        {
!               $sql = 'delete from phpgw_acl where acl_appname="sitemgr" and 
acl_location="'.
!                       $location.'"';
                $this->db->query($sql,__LINE__,__FILE__);
        }
--- 51,56 ----
        function remove_location($location)
        {
!               $sql = 'delete from phpgw_acl where acl_appname=\'sitemgr\' and 
acl_location=\''.
!                       $location.'\'';
                $this->db->query($sql,__LINE__,__FILE__);
        }

Index: class.Categories_db_SO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Categories_db_SO.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.Categories_db_SO.inc.php      11 Sep 2002 19:22:32 -0000      1.6
--- class.Categories_db_SO.inc.php      11 Sep 2002 22:39:28 -0000      1.7
***************
*** 23,28 ****
                {
                        //Create a section for categoriy and return the newly 
added category id.
!                       $sql = 'INSERT INTO phpgw_sitemgr_categories (name, 
description) VALUES ("'
!                               . $name . '","' . $description . '")';
                        $this->db->query($sql, __LINE__, __FILE__);
                        return 
$this->db->get_last_insert_id('phpgw_sitemgr_categories','cat_id');
--- 23,28 ----
                {
                        //Create a section for categoriy and return the newly 
added category id.
!                       $sql = 'INSERT INTO phpgw_sitemgr_categories (name, 
description) VALUES (\''
!                               . $name . '\',\'' . $description . '\')';
                        $this->db->query($sql, __LINE__, __FILE__);
                        return 
$this->db->get_last_insert_id('phpgw_sitemgr_categories','cat_id');
***************
*** 31,35 ****
                function removeCategory($cat_id)
                {
!                       $sql = 'DELETE FROM phpgw_sitemgr_categories WHERE 
cat_id="' . $cat_id . '"';
                        $this->db->query($sql, __LINE__, __FILE__);
                        return true;
--- 31,35 ----
                function removeCategory($cat_id)
                {
!                       $sql = 'DELETE FROM phpgw_sitemgr_categories WHERE 
cat_id=\'' . $cat_id . '\'';
                        $this->db->query($sql, __LINE__, __FILE__);
                        return true;
***************
*** 38,45 ****
                function saveCategory($cat_info)
                {
!                       $sql = 'UPDATE phpgw_sitemgr_categories SET name="' .
!                               $cat_info->name . '", description="' . 
$cat_info->description .
!                               '", sort_order="'. (int) $cat_info->sort_order .
!                               '" WHERE cat_id="' . $cat_info->id . '"';
                        $this->db->query($sql, __LINE__, __FILE__);
                }
--- 38,45 ----
                function saveCategory($cat_info)
                {
!                       $sql = 'UPDATE phpgw_sitemgr_categories SET name=\'' .
!                               $cat_info->name . '\', description=\'' . 
$cat_info->description .
!                               '\', sort_order=\''. (int) 
$cat_info->sort_order .
!                               '\' WHERE cat_id=\'' . $cat_info->id . '\'';
                        $this->db->query($sql, __LINE__, __FILE__);
                }
***************
*** 47,51 ****
                function getCategory($cat_id)
                {
!                       $sql = 'SELECT * FROM phpgw_sitemgr_categories WHERE 
cat_id="' . $cat_id . '"';
                        $this->db->query($sql, __LINE__, __FILE__);
                        if ($this->db->next_record())
--- 47,51 ----
                function getCategory($cat_id)
                {
!                       $sql = 'SELECT * FROM phpgw_sitemgr_categories WHERE 
cat_id=\'' . $cat_id . '\'';
                        $this->db->query($sql, __LINE__, __FILE__);
                        if ($this->db->next_record())
***************
*** 99,103 ****
                                if (!$new_cat_id)
                                {
!                                       return("ERROR!  I need to update your 
tables, but I can't upgrade tables until you get the latest 
phpgwapi/inc/class.categories.inc.php from the 0.9.14 branch of CVS!  Please 
get this now.");
                                }
                                $old_cat = $this->getCategory($old_cat_id);
--- 99,103 ----
                                if (!$new_cat_id)
                                {
!                                       return('ERROR!  I need to update your 
tables, but I can\'t upgrade tables until you get the latest 
phpgwapi/inc/class.categories.inc.php from the 0.9.14 branch of CVS!  Please 
get this now.');
                                }
                                $old_cat = $this->getCategory($old_cat_id);
***************
*** 124,129 ****
                        while (list($page_id,$new_cat_id) = each($update))
                        {
!                               $sql = 'UPDATE phpgw_sitemgr_pages SET 
cat_id="'.$new_cat_id.
!                                       '" WHERE page_id="'.$page_id.'"';
                                $this->db->query($sql,__LINE__,__FILE__);
                                $rv .= "\n<br>&nbsp;&nbsp;&nbsp;&nbsp;Updating 
page ".$page_id;
--- 124,129 ----
                        while (list($page_id,$new_cat_id) = each($update))
                        {
!                               $sql = 'UPDATE phpgw_sitemgr_pages SET 
cat_id=\''.$new_cat_id.
!                                       '\' WHERE page_id=\''.$page_id.'\'';
                                $this->db->query($sql,__LINE__,__FILE__);
                                $rv .= "\n<br>&nbsp;&nbsp;&nbsp;&nbsp;Updating 
page ".$page_id;

Index: class.MainMenu_UI.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.MainMenu_UI.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.MainMenu_UI.inc.php   7 Sep 2002 05:57:28 -0000       1.2
--- class.MainMenu_UI.inc.php   11 Sep 2002 22:39:28 -0000      1.3
***************
*** 1,11 ****
  <?php
!       
/***************************************************************************\
!       * http://www.phpgroupware.org                                           
    *
!       * -------------------------------------------------                     
    *
!       * This program is free software; you can redistribute it and/or modify 
it   *
!       * under the terms of the GNU General Public License as published by the 
    *
!       * Free Software Foundation; either version 2 of the License, or (at 
your    *
!       * option) any later version.                                            
    *
!       
\***************************************************************************/
        /* $Id$ */
        
--- 1,11 ----
  <?php
!       
/*************************************************************************\
!       * http://www.phpgroupware.org                                           
  *
!       * -------------------------------------------------                     
  *
!       * This program is free software; you can redistribute it and/or modify 
it *
!       * under the terms of the GNU General Public License as published by the 
  *
!       * Free Software Foundation; either version 2 of the License, or (at 
your  *
!       * option) any later version.                                            
  *
!       
\*************************************************************************/
        /* $Id$ */
        
***************
*** 21,25 ****
                function MainMenu_UI()
                {
!                       $this->t = $GLOBALS["phpgw"]->template;
                        $this->acl = CreateObject('sitemgr.ACL_BO');
                }
--- 21,25 ----
                function MainMenu_UI()
                {
!                       $this->t = $GLOBALS['phpgw']->template;
                        $this->acl = CreateObject('sitemgr.ACL_BO');
                }

Index: class.Pages_SO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Pages_SO.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.Pages_SO.inc.php      11 Sep 2002 19:22:32 -0000      1.6
--- class.Pages_SO.inc.php      11 Sep 2002 22:39:28 -0000      1.7
***************
*** 17,21 ****
                        else
                        {
!                               $sql = 'SELECT page_id FROM phpgw_sitemgr_pages 
WHERE cat_id="' . $cat_id . '" ORDER BY sort_order';
                        }
                        $this->db->query($sql,__LINE__,__FILE__);
--- 17,21 ----
                        else
                        {
!                               $sql = 'SELECT page_id FROM phpgw_sitemgr_pages 
WHERE cat_id=\'' . $cat_id . '\' ORDER BY sort_order';
                        }
                        $this->db->query($sql,__LINE__,__FILE__);
***************
*** 33,37 ****
                function addPage($cat_id)
                {
!                       $sql = 'INSERT INTO phpgw_sitemgr_pages (cat_id) VALUES 
("' . $cat_id . '")';
                        $this->db->query($sql, __LINE__,__FILE__);
                        return 
$this->db->get_last_insert_id('phpgw_sitemgr_pages','page_id');
--- 33,37 ----
                function addPage($cat_id)
                {
!                       $sql = 'INSERT INTO phpgw_sitemgr_pages (cat_id) VALUES 
(\'' . $cat_id . '\')';
                        $this->db->query($sql, __LINE__,__FILE__);
                        return 
$this->db->get_last_insert_id('phpgw_sitemgr_pages','page_id');
***************
*** 40,44 ****
                function removePagesInCat($cat_id)
                {
!                       $sql = 'DELETE FROM phpgw_sitemgr_pages WHERE 
cat_id="'.$cat_id.'"';
                        $this->db->query($sql,__LINE__,__FILE__);
                }
--- 40,44 ----
                function removePagesInCat($cat_id)
                {
!                       $sql = 'DELETE FROM phpgw_sitemgr_pages WHERE 
cat_id=\''.$cat_id.'\'';
                        $this->db->query($sql,__LINE__,__FILE__);
                }
***************
*** 46,50 ****
                function removePage($page_id)
                {
!                       $sql = 'DELETE FROM phpgw_sitemgr_pages WHERE 
page_id="' . $page_id . '"';
                        $this->db->query($sql, __LINE__,__FILE__);
                }
--- 46,50 ----
                function removePage($page_id)
                {
!                       $sql = 'DELETE FROM phpgw_sitemgr_pages WHERE 
page_id=\'' . $page_id . '\'';
                        $this->db->query($sql, __LINE__,__FILE__);
                }
***************
*** 52,59 ****
                function pageExists($page_name,$exclude_page_id)
                {
!                       $sql = 'SELECT page_id FROM phpgw_sitemgr_pages WHERE 
name="' . $page_name . '"';
                        if ($exclude_page_id)
                        {
!                               $sql .= ' and page_id!="'. $exclude_page_id . 
'"';
                        }
                        $this->db->query($sql,__LINE__,__FILE__);
--- 52,59 ----
                function pageExists($page_name,$exclude_page_id)
                {
!                       $sql = 'SELECT page_id FROM phpgw_sitemgr_pages WHERE 
name=\'' . $page_name . '\'';
                        if ($exclude_page_id)
                        {
!                               $sql .= ' and page_id!=\''. $exclude_page_id . 
'\'';
                        }
                        $this->db->query($sql,__LINE__,__FILE__);
***************
*** 70,74 ****
                function getPageByName($page_name)
                {
!                       $sql = 'SELECT * FROM phpgw_sitemgr_pages WHERE name="' 
. $page_name . '"';
                        $this->db->query($sql,__LINE__,__FILE__);
                        if ($this->db->next_record())
--- 70,74 ----
                function getPageByName($page_name)
                {
!                       $sql = 'SELECT * FROM phpgw_sitemgr_pages WHERE 
name=\'' . $page_name . '\'';
                        $this->db->query($sql,__LINE__,__FILE__);
                        if ($this->db->next_record())
***************
*** 93,97 ****
                function getPage($page_id)
                {
!                       $sql = 'SELECT * FROM phpgw_sitemgr_pages WHERE 
page_id="' . $page_id . '"';
                        $this->db->query($sql,__LINE__,__FILE__);
                        if ($this->db->next_record())
--- 93,97 ----
                function getPage($page_id)
                {
!                       $sql = 'SELECT * FROM phpgw_sitemgr_pages WHERE 
page_id=\'' . $page_id . '\'';
                        $this->db->query($sql,__LINE__,__FILE__);
                        if ($this->db->next_record())
***************
*** 117,128 ****
                {
                        $sql = 'UPDATE phpgw_sitemgr_pages SET ' . 
!                               'cat_id="' . $pageInfo->cat_id . '",' .
!                               'name="' . $pageInfo->name . '",' .
!                               'sort_order="' . (int) $pageInfo->sort_order . 
'",' .
!                               'title="' . $pageInfo->title . '",' .
!                               'subtitle="' . $pageInfo->subtitle . '",' .
!                               'content="' . $pageInfo->content . '", ' .
!                               'hide_page="' . $pageInfo->hidden . '" ' .
!                               'WHERE page_id="' . $pageInfo->id . '"';
                        $this->db->query($sql, __LINE__,__FILE__);
                        return true;
--- 117,128 ----
                {
                        $sql = 'UPDATE phpgw_sitemgr_pages SET ' . 
!                               'cat_id=\'' . $pageInfo->cat_id . '\',' .
!                               'name=\'' . $pageInfo->name . '\',' .
!                               'sort_order=\'' . (int) $pageInfo->sort_order . 
'\',' .
!                               'title=\'' . $pageInfo->title . '\',' .
!                               'subtitle=\'' . $pageInfo->subtitle . '\',' .
!                               'content=\'' . $pageInfo->content . '\', ' .
!                               'hide_page=\'' . $pageInfo->hidden . '\' ' .
!                               'WHERE page_id=\'' . $pageInfo->id . '\'';
                        $this->db->query($sql, __LINE__,__FILE__);
                        return true;

Index: class.contributor_ManagePage_UI.inc.php
===================================================================
RCS file: 
/cvsroot/phpgroupware/sitemgr/inc/class.contributor_ManagePage_UI.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.contributor_ManagePage_UI.inc.php     11 Sep 2002 06:22:44 -0000      
1.6
--- class.contributor_ManagePage_UI.inc.php     11 Sep 2002 22:39:28 -0000      
1.7
***************
*** 1,11 ****
  <?php
!       
/***************************************************************************\
!       * http://www.phpgroupware.org                                           
    *
!       * -------------------------------------------------                     
    *
!       * This program is free software; you can redistribute it and/or modify 
it   *
!       * under the terms of the GNU General Public License as published by the 
    *
!       * Free Software Foundation; either version 2 of the License, or (at 
your    *
!       * option) any later version.                                            
    *
!       
\***************************************************************************/
        /* $Id$ */
        
--- 1,11 ----
  <?php
!       
/*************************************************************************\
!       * http://www.phpgroupware.org                                           
  *
!       * -------------------------------------------------                     
  *
!       * This program is free software; you can redistribute it and/or modify 
it *
!       * under the terms of the GNU General Public License as published by the 
  *
!       * Free Software Foundation; either version 2 of the License, or (at 
your  *
!       * option) any later version.                                            
  *
!       
\*************************************************************************/
        /* $Id$ */
        
***************
*** 29,33 ****
                function Contributor_ManagePage_UI()                    
                {
!                       $this->t = $GLOBALS["phpgw"]->template;
                        $this->pagebo = CreateObject('sitemgr.Pages_BO', True);
                        $this->categorybo = 
CreateObject('sitemgr.Categories_BO',True);
--- 29,33 ----
                function Contributor_ManagePage_UI()                    
                {
!                       $this->t = $GLOBALS['phpgw']->template;
                        $this->pagebo = CreateObject('sitemgr.Pages_BO', True);
                        $this->categorybo = 
CreateObject('sitemgr.Categories_BO',True);
***************
*** 93,97 ****
                        }
                        
!                       $trans = array("{" => "&#123;", "}" => "&#125;");
                        if($this->page->hidden)
                          {
--- 93,97 ----
                        }
                        
!                       $trans = array('{' => '&#123;', '}' => '&#125;');
                        if($this->page->hidden)
                          {
***************
*** 160,164 ****
                                        if(!$this->page->id)
                                        {
!                                               $save_msg = "You don't have 
permission to write in the category";
                                        }
                                }
--- 160,164 ----
                                        if(!$this->page->id)
                                        {
!                                               $save_msg = 'You don\'t have 
permission to write in the category';
                                        }
                                }
***************
*** 198,202 ****
                        if($btnPrev)
                        {
!                               echo "Go back to the category manager";
                                $btnEditPage = False;
                                $btnPrev = False;
--- 198,202 ----
                        if($btnPrev)
                        {
!                               echo 'Go back to the category manager';
                                $btnEditPage = False;
                                $btnPrev = False;
***************
*** 287,291 ****
                                else
                                {
!                                       echo "I'm sorry, you do not have write 
permissions for any site categories.<br><br>";
                                }
                        }
--- 287,291 ----
                                else
                                {
!                                       echo 'I\'m sorry, you do not have write 
permissions for any site categories.<br><br>';
                                }
                        }

Index: class.sitePreference_SO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.sitePreference_SO.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.sitePreference_SO.inc.php     29 Aug 2002 03:03:17 -0000      1.1.1.1
--- class.sitePreference_SO.inc.php     11 Sep 2002 22:39:28 -0000      1.2
***************
*** 11,20 ****
                function setPreference($name, $value)
                {
!                       $sql = 'SELECT pref_id FROM phpgw_sitemgr_preferences 
WHERE name="' . $name . '"';
                        $this->db->query($sql,__LINE__,__FILE__);
                        if ($this->db->next_record())
                        {
!                               $sql = 'UPDATE phpgw_sitemgr_preferences SET 
value="' . $value . 
!                                       '" WHERE pref_id="' . 
$this->db->f('pref_id') . '"';
                                $this->db->query($sql,__LINE__,__FILE__);
                                return true;
--- 11,20 ----
                function setPreference($name, $value)
                {
!                       $sql = 'SELECT pref_id FROM phpgw_sitemgr_preferences 
WHERE name=\'' . $name . '\'';
                        $this->db->query($sql,__LINE__,__FILE__);
                        if ($this->db->next_record())
                        {
!                               $sql = 'UPDATE phpgw_sitemgr_preferences SET 
value=\'' . $value . 
!                                       '\' WHERE pref_id=\'' . 
$this->db->f('pref_id') . '\'';
                                $this->db->query($sql,__LINE__,__FILE__);
                                return true;
***************
*** 23,27 ****
                        {
                                $sql = 'INSERT INTO phpgw_sitemgr_preferences 
(name, value) VALUES ' .
!                                       '("' . $name . '","' . $value . '")';
                                $this->db->query($sql,__LINE__,__FILE__);
                        }
--- 23,27 ----
                        {
                                $sql = 'INSERT INTO phpgw_sitemgr_preferences 
(name, value) VALUES ' .
!                                       '(\'' . $name . '\',\'' . $value . 
'\')';
                                $this->db->query($sql,__LINE__,__FILE__);
                        }
***************
*** 30,34 ****
                function getPreference($name)
                {
!                       $sql = 'SELECT value FROM phpgw_sitemgr_preferences 
WHERE name="' . $name . '"';
                        $this->db->query($sql,__LINE__,__FILE__);
                        if ($this->db->next_record())
--- 30,34 ----
                function getPreference($name)
                {
!                       $sql = 'SELECT value FROM phpgw_sitemgr_preferences 
WHERE name=\'' . $name . '\'';
                        $this->db->query($sql,__LINE__,__FILE__);
                        if ($this->db->next_record())





reply via email to

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