phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: bookmarks/inc class.bookmarks.inc.php,1.22,1.23


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: bookmarks/inc class.bookmarks.inc.php,1.22,1.23
Date: Mon, 17 Jun 2002 21:02:11 -0400

Update of /cvsroot/phpgroupware/bookmarks/inc
In directory subversions:/tmp/cvs-serv19540/inc

Modified Files:
        class.bookmarks.inc.php 
Log Message:
Formatting



Index: class.bookmarks.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/bookmarks/inc/class.bookmarks.inc.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** class.bookmarks.inc.php     6 Mar 2002 01:59:23 -0000       1.22
--- class.bookmarks.inc.php     18 Jun 2002 01:02:09 -0000      1.23
***************
*** 172,180 ****
                        $this->config      = $this->config_data;
  
!                       if (! 
$GLOBALS['phpgw']->categories->exists('appandmains','No category'))
                        {
                                $newcat = array(
!                                       'name'   => 'No category',
!                                       'descr'  => '',
                                        'parent' => 0,
                                        'access' => '',
--- 172,180 ----
                        $this->config      = $this->config_data;
  
!                       
if(!$GLOBALS['phpgw']->categories->exists('appandmains','No category'))
                        {
                                $newcat = array(
!                                       'name'   => 'No category',
!                                       'descr'  => '',
                                        'parent' => 0,
                                        'access' => '',
***************
*** 192,196 ****
                        //echo "<br>id: $id required: $required grants: " . 
$this->grants[$this->db->f('bm_owner')] . " owner: " . $this->db->f('bm_owner') 
. " user: " . $GLOBALS['phpgw_info']['user']['account_id'];
  
!                       if (($this->grants[$this->db->f('bm_owner')] & 
$required) || ($this->db->f('bm_owner') == 
$GLOBALS['phpgw_info']['user']['account_id']))
                        {
                                return True;
--- 192,197 ----
                        //echo "<br>id: $id required: $required grants: " . 
$this->grants[$this->db->f('bm_owner')] . " owner: " . $this->db->f('bm_owner') 
. " user: " . $GLOBALS['phpgw_info']['user']['account_id'];
  
!                       if(($this->grants[$this->db->f('bm_owner')] & 
$required) ||
!                               ($this->db->f('bm_owner') == 
$GLOBALS['phpgw_info']['user']['account_id']))
                        {
                                return True;
***************
*** 271,275 ****
                        $db = $GLOBALS['phpgw']->db;
  
!                       if (! $this->validate($values))
                        {
                                return False;
--- 272,276 ----
                        $db = $GLOBALS['phpgw']->db;
  
!                       if(!$this->validate($values))
                        {
                                return False;
***************
*** 281,285 ****
                        $db->next_record();
  
!                       if (! $return_no_errors && $db->f(0) != 0)
                        {
                                $error_msg .= sprintf('<br>URL <B>%s</B> 
already exists!', $values['url']);
--- 282,286 ----
                        $db->next_record();
  
!                       if(!$return_no_errors && $db->f(0) != 0)
                        {
                                $error_msg .= sprintf('<br>URL <B>%s</B> 
already exists!', $values['url']);
***************
*** 287,301 ****
                        }
  
!                       if ($return_no_errors && $db->f(0) != 0)
                        {
                                return True;
                        }
  
!                       if (! $values['access'])
                        {
                                $values['access'] = 'public';
                        }
  
!                       if (! $values['timestamps'])
                        {
                                $values['timestamps'] = time() . ',0,0';
--- 288,302 ----
                        }
  
!                       if($return_no_errors && $db->f(0) != 0)
                        {
                                return True;
                        }
  
!                       if(!$values['access'])
                        {
                                $values['access'] = 'public';
                        }
  
!                       if(!$values['timestamps'])
                        {
                                $values['timestamps'] = time() . ',0,0';
***************
*** 305,309 ****
                        $subcategory = ereg_replace('!','',$subcategory);
  
!                       if (! $return_no_errors && ! $category)
                        {
                                $error_msg .= 'You must select a category';
--- 306,310 ----
                        $subcategory = ereg_replace('!','',$subcategory);
  
!                       if(!$return_no_errors && ! $category)
                        {
                                $error_msg .= 'You must select a category';
***************
*** 320,324 ****
                        $db->query($query,__LINE__,__FILE__);
  
!                       if (! $return_no_errors)
                        {
                                $msg .= 'Bookmark created successfully.';
--- 321,325 ----
                        $db->query($query,__LINE__,__FILE__);
  
!                       if(!$return_no_errors)
                        {
                                $msg .= 'Bookmark created successfully.';
***************
*** 333,337 ****
  
                        /*
!                       if (!$this->validate(&$url, &$name, &$ldesc, 
&$keywords, &$category, &$subcategory, &$rating, &$public, &$public_db))
                        {
                                return False;
--- 334,338 ----
  
                        /*
!                       if(!$this->validate(&$url, &$name, &$ldesc, &$keywords, 
&$category, &$subcategory, &$rating, &$public, &$public_db))
                        {
                                return False;
***************
*** 339,343 ****
                        */
  
!                       if (! $values['access'])
                        {
                                $values['access'] = 'public';
--- 340,344 ----
                        */
  
!                       if(!$values['access'])
                        {
                                $values['access'] = 'public';
***************
*** 355,367 ****
                        // Update bookmark information.
                        $query = sprintf("update phpgw_bookmarks set 
bm_url='%s', bm_name='%s', bm_desc='%s', "
!                             . "bm_keywords='%s', bm_category='%s', 
bm_subcategory='%s', bm_rating='%s',"
!                             . "bm_info='%s', bm_access='%s' where 
bm_id='%s'", 
!                                $values['url'], addslashes($values['name']), 
addslashes($values['desc']), addslashes($values['keywords']), 
!                                $category, $subcategory, $values['rating'], 
$timestamps, $values['access'], $id);
  
                        $GLOBALS['phpgw']->db->query($query,__LINE__,__FILE__);
  
                        $msg .= lang('Bookmark changed sucessfully');
!       
                        return true;
                }
--- 356,368 ----
                        // Update bookmark information.
                        $query = sprintf("update phpgw_bookmarks set 
bm_url='%s', bm_name='%s', bm_desc='%s', "
!                               . "bm_keywords='%s', bm_category='%s', 
bm_subcategory='%s', bm_rating='%s',"
!                               . "bm_info='%s', bm_access='%s' where 
bm_id='%s'", 
!                               $values['url'], addslashes($values['name']), 
addslashes($values['desc']), addslashes($values['keywords']), 
!                               $category, $subcategory, $values['rating'], 
$timestamps, $values['access'], $id);
  
                        $GLOBALS['phpgw']->db->query($query,__LINE__,__FILE__);
  
                        $msg .= lang('Bookmark changed sucessfully');
! 
                        return true;
                }
***************
*** 376,380 ****
                        $query = sprintf("delete from phpgw_bookmarks where 
bm_id='%s' and bm_owner='%s'", $id, 
$GLOBALS['phpgw_info']["user"]["account_id"]);
                        $db->query($query,__LINE__,__FILE__);
!                       if ($db->Errno != 0)
                        {
                                return False;
--- 377,381 ----
                        $query = sprintf("delete from phpgw_bookmarks where 
bm_id='%s' and bm_owner='%s'", $id, 
$GLOBALS['phpgw_info']["user"]["account_id"]);
                        $db->query($query,__LINE__,__FILE__);
!                       if($db->Errno != 0)
                        {
                                return False;
***************
*** 402,411 ****
         
                        // Do we have all necessary data?
!                       if (! $values['url'] || $values['url'] == 'http://')
                        {
                                $error_msg .= '<br>URL is required.';
                        }
  
!                       if (! $values['name'])
                        {
                                $error_msg .= '<br>' . lang('Name is required');
--- 403,412 ----
         
                        // Do we have all necessary data?
!                       if(!$values['url'] || $values['url'] == 'http://')
                        {
                                $error_msg .= '<br>URL is required.';
                        }
  
!                       if(!$values['name'])
                        {
                                $error_msg .= '<br>' . lang('Name is required');
***************
*** 413,420 ****
  
                        // does the admin want us to check URL format
!                       if ($GLOBALS['phpgw']->bookmarks->url_format_check > 0)
                        {
                                // Is the URL format valid
!                               if ($values['url'] == 'http://')
                                {
                                        $error_msg .= '<br>You must enter a 
URL';
--- 414,421 ----
  
                        // does the admin want us to check URL format
!                       if($GLOBALS['phpgw']->bookmarks->url_format_check > 0)
                        {
                                // Is the URL format valid
!                               if($values['url'] == 'http://')
                                {
                                        $error_msg .= '<br>You must enter a 
URL';
***************
*** 422,433 ****
                                else
                                {
!                                       if (! $validate->is_url($values['url']))
                                        {
!                                               $format_msg = '<br>URL invalid. 
Format must be <strong>http://</strong> or 
!                                   <strong>ftp://</strong> followed by a valid 
hostname and 
!                                   URL!<br><small>' .  $validate->ERROR . 
'</small>';
!         
                                                // does the admin want this 
formatted as a warning or an error?
!                                               if 
($GLOBALS['phpgw']->bookmarks->url_format_check == 2)
                                                {
                                                        $error_msg .= 
$format_msg;
--- 423,433 ----
                                else
                                {
!                                       if(!$validate->is_url($values['url']))
                                        {
!                                               $format_msg = '<br>URL invalid. 
Format must be <strong>http://</strong> or
!  <strong>ftp://</strong> followed by a valid hostname and URL!<br><small>' .  
$validate->ERROR . '</small>';
! 
                                                // does the admin want this 
formatted as a warning or an error?
!                                               
if($GLOBALS['phpgw']->bookmarks->url_format_check == 2)
                                                {
                                                        $error_msg .= 
$format_msg;
***************
*** 441,445 ****
                        }    
  
!                       if ($error_msg)
                        {
                                return False;
--- 441,445 ----
                        }    
  
!                       if($error_msg)
                        {
                                return False;
***************
*** 459,463 ****
                        /*
                        $db->query("select count(*) as total_bookmarks from 
bookmarks where username = '"
!                       . $GLOBALS['phpgw_info']["user"]["account_id"] . "' or 
bookmarks.public_f='Y'",__LINE__,__FILE__);
                        $db->next_record();
                        
$GLOBALS['phpgw']->common->appsession($db->f("total_bookmarks"));
--- 459,463 ----
                        /*
                        $db->query("select count(*) as total_bookmarks from 
bookmarks where username = '"
!                               . $GLOBALS['phpgw_info']["user"]["account_id"] 
. "' or bookmarks.public_f='Y'",__LINE__,__FILE__);
                        $db->next_record();
                        
$GLOBALS['phpgw']->common->appsession($db->f("total_bookmarks"));
***************
*** 471,479 ****
                        $db->query($query,__LINE__,__FILE__);
                        if ($db->Errno == 0) {
!                               if ($db->next_record()) {
                                        //               $total_public = 
$db->f("total_public");
                                        echo "TEST: " . $db->f("total_public");
                                        
$GLOBALS['phpgw']->common->appsession($db->f("total_public"));
!                               } else {
                                        echo "TEST: False";
                                        return False;
--- 471,482 ----
                        $db->query($query,__LINE__,__FILE__);
                        if ($db->Errno == 0) {
!                               if($db->next_record())
!                               {
                                        //               $total_public = 
$db->f("total_public");
                                        echo "TEST: " . $db->f("total_public");
                                        
$GLOBALS['phpgw']->common->appsession($db->f("total_public"));
!                               }
!                               else
!                               {
                                        echo "TEST: False";
                                        return False;
***************
*** 484,492 ****
                                $query = sprintf("update auth_user set 
total_public_bookmarks=%s where username = '%s'",$total_public, $uname);
                                $db->query($query,__LINE__,__FILE__);
!                               if ($db->Errno != 0) {
                                        return False;
                                }
                                return true;*/
!                               //}
                }
  
--- 487,496 ----
                                $query = sprintf("update auth_user set 
total_public_bookmarks=%s where username = '%s'",$total_public, $uname);
                                $db->query($query,__LINE__,__FILE__);
!                               if($db->Errno != 0)
!                               {
                                        return False;
                                }
                                return true;*/
!                       //}
                }
  
***************
*** 496,504 ****
  
                        $filtermethod = '( bm_owner=' . 
$GLOBALS['phpgw_info']['user']['account_id'];
!                       if (is_array($GLOBALS['phpgw']->bookmarks->grants))
                        {
                                $grants = $GLOBALS['phpgw']->bookmarks->grants;
                                reset($grants);
!                               while (list($user) = each($grants))
                                {
                                        $public_user_list[] = $user;
--- 500,508 ----
  
                        $filtermethod = '( bm_owner=' . 
$GLOBALS['phpgw_info']['user']['account_id'];
!                       if(is_array($GLOBALS['phpgw']->bookmarks->grants))
                        {
                                $grants = $GLOBALS['phpgw']->bookmarks->grants;
                                reset($grants);
!                               while(list($user) = each($grants))
                                {
                                        $public_user_list[] = $user;
***************
*** 512,516 ****
                        }
  
!                       if ($bm_cat || $bm_subcat)
                        {
                                if($bm_cat)
--- 516,520 ----
                        }
  
!                       if($bm_cat || $bm_subcat)
                        {
                                if($bm_cat)




reply via email to

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