[Jaws-commits] r13427 - branches/0.8/html/include/Jaws

afz at jaws-project.com afz at jaws-project.com
Mon Aug 13 17:46:15 UTC 2012


Author: afz
Date: 2012-08-13 17:46:15 +0000 (Mon, 13 Aug 2012)
New Revision: 13427

Modified:
   branches/0.8/html/include/Jaws/User.php
Log:
[Jaws_User]: Added group enabled filed to Add/Update methods

Modified: branches/0.8/html/include/Jaws/User.php
===================================================================
--- branches/0.8/html/include/Jaws/User.php	2012-08-13 17:20:40 UTC (rev 13426)
+++ branches/0.8/html/include/Jaws/User.php	2012-08-13 17:46:15 UTC (rev 13427)
@@ -929,22 +929,24 @@
      * @param   string  $name        Group's name
      * @param   string  $title       Group's title
      * @param   string  $description Group's description
+     * @param   boolean $enabled     Group's status
      * @param   bool    $removable   (Optional) Can the group be removed by users (via UI)?
      * @return  boolean Returns true if group  was sucessfully added, false if not
      */
-    function AddGroup($name, $title, $description, $removable = true)
+    function AddGroup($name, $title, $description, $enabled, $removable = true)
     {
         $params = array();
         $params['name']        = $name;
         $params['title']       = $title;
         $params['description'] = $description;
-        $params['removable']   = (is_bool($removable)) ? $removable : true;
-        
+        $params['removable']   = (bool)$removable;
+        $params['enabled']     = (bool)$enabled;
+
         $sql = '
             INSERT INTO [[groups]]
-                ([name], [title], [description], [removable])
+                ([name], [title], [description], [removable], [enabled])
             VALUES
-                ({name}, {title}, {description}, {removable})';
+                ({name}, {title}, {description}, {removable}, {enabled})';
 
         $result = $GLOBALS['db']->query($sql, $params);
         if (Jaws_Error::IsError($result)) {
@@ -975,21 +977,24 @@
      * @param   string  $name        Group's title
      * @param   string  $title       Group's name
      * @param   string  $description Group's description
+     * @param   boolean $enabled     Group's status
      * @return  boolean Returns true if group was sucessfully updated, false if not
      */
-    function UpdateGroup($id, $name, $title, $description)
+    function UpdateGroup($id, $name, $title, $description, $enabled)
     {
         $params = array();
         $params['id']          = $id;
         $params['name']        = $name;
         $params['title']       = $title;
         $params['description'] = $description;
+        $params['enabled']     = (bool)$enabled;
 
         $sql = '
             UPDATE [[groups]] SET
                 [name]        = {name},
                 [title]       = {title},
-                [description] = {description}
+                [description] = {description},
+                [enabled]     = {enabled}
             WHERE [id] = {id}';
 
         $result = $GLOBALS['db']->query($sql, $params);



More information about the Jaws-commits mailing list