[Jaws-commits] r13298 - in trunk/jaws/html/gadgets/Users: . schema

afz at jaws-project.com afz at jaws-project.com
Mon Aug 6 19:55:48 UTC 2012


Author: afz
Date: 2012-08-06 19:55:48 +0000 (Mon, 06 Aug 2012)
New Revision: 13298

Added:
   trunk/jaws/html/gadgets/Users/schema/0.8.7.xml
Modified:
   trunk/jaws/html/gadgets/Users/AdminModel.php
   trunk/jaws/html/gadgets/Users/Info.php
   trunk/jaws/html/gadgets/Users/schema/schema.xml
Log:
[Users]: starting ad new features...

Modified: trunk/jaws/html/gadgets/Users/AdminModel.php
===================================================================
--- trunk/jaws/html/gadgets/Users/AdminModel.php	2012-08-05 22:24:06 UTC (rev 13297)
+++ trunk/jaws/html/gadgets/Users/AdminModel.php	2012-08-06 19:55:48 UTC (rev 13298)
@@ -47,77 +47,8 @@
      */
     function UpdateGadget($old, $new)
     {
-        if (version_compare($old, '0.8.0', '<')) {
-            $result = $this->installSchema('0.8.0.xml', '', "$old.xml");
-            if (Jaws_Error::IsError($result)) {
-                return $result;
-            }
-        }
-
-        if (version_compare($old, '0.8.2', '<')) {
-            $result = $this->installSchema('0.8.2.xml', '', '0.8.0.xml');
-            if (Jaws_Error::IsError($result)) {
-                return $result;
-            }
-        }
-
-        if (version_compare($old, '0.8.4', '<')) {
-            $result = $this->installSchema('0.8.4.xml', '', '0.8.2.xml');
-            if (Jaws_Error::IsError($result)) {
-                return $result;
-            }
-
-            // Registry keys
-            $GLOBALS['app']->Registry->NewKey('/gadgets/Users/register_notification', 'true');
-
-            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Users/ManageProperties',       'false');
-            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Users/ManageUserACLs',         'false');
-            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Users/ManageGroupACLs',        'false');
-            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Users/EditAccountInformation', 'false');
-            $GLOBALS['app']->ACL->DeleteKey('/ACL/gadgets/Users/ManageACL');
-        }
-
-        if (version_compare($old, '0.8.5', '<')) {
-            $result = $this->installSchema('0.8.5.xml', '', '0.8.4.xml');
-            if (Jaws_Error::IsError($result)) {
-                return $result;
-            }
-
-            require_once JAWS_PATH . 'include/Jaws/User.php';
-            $userModel = new Jaws_User;
-
-            if (version_compare($old, '0.8.0', '<')) {
-                //Create the group 'Jaws_Users'
-                $userModel->addGroup('users', 'Users', '', false); //Don't check if it returns true or false
-            }
-
-            $groups = $userModel->GetGroups();
-            if (!Jaws_Error::IsError($groups)) {
-                foreach ($groups as $group) {
-                    if (empty($group['title'])) {
-                        $userModel->UpdateGroup($group['id'],
-                                                $group['name'],
-                                                $group['name'],
-                                                $group['description']);
-                    }
-                }
-            }
-
-        }
-
-        if (version_compare($old, '0.8.6', '<')) {
-            $result = $this->installSchema('0.8.6.xml', '', '0.8.5.xml');
-            if (Jaws_Error::IsError($result)) {
-                return $result;
-            }
-
-            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Users/EditAccountPassword',    'false');
-            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Users/EditAccountProfile',     'false');
-            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Users/EditAccountPreferences', 'false');
-        }
-
         if (version_compare($old, '0.8.7', '<')) {
-            $result = $this->installSchema('schema.xml', '', '0.8.6.xml');
+            $result = $this->installSchema('0.8.7.xml', '', '0.8.6.xml');
             if (Jaws_Error::IsError($result)) {
                 return $result;
             }
@@ -135,6 +66,13 @@
             $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Users/ManageAuthenticationMethod', 'false');
         }
 
+        if (version_compare($old, '0.8.9', '<')) {
+            $result = $this->installSchema('schema.xml', '', '0.8.7.xml');
+            if (Jaws_Error::IsError($result)) {
+                return $result;
+            }
+        }
+
         return true;
     }
 

Modified: trunk/jaws/html/gadgets/Users/Info.php
===================================================================
--- trunk/jaws/html/gadgets/Users/Info.php	2012-08-05 22:24:06 UTC (rev 13297)
+++ trunk/jaws/html/gadgets/Users/Info.php	2012-08-06 19:55:48 UTC (rev 13298)
@@ -20,7 +20,7 @@
         parent::Init('Users');
         $this->GadgetName(_t('USERS_NAME'));
         $this->GadgetDescription(_t('USERS_DESCRIPTION'));
-        $this->GadgetVersion('0.8.8');
+        $this->GadgetVersion('0.8.9');
         $this->Doc('gadget/Users');
         $this->SetAttribute('core_gadget', true);
 

Added: trunk/jaws/html/gadgets/Users/schema/0.8.7.xml
===================================================================
--- trunk/jaws/html/gadgets/Users/schema/0.8.7.xml	                        (rev 0)
+++ trunk/jaws/html/gadgets/Users/schema/0.8.7.xml	2012-08-06 19:55:48 UTC (rev 13298)
@@ -0,0 +1,287 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<database>
+
+ <name><variable>database</variable></name>
+
+ <table>
+    <name><variable>table_prefix</variable>users</name>
+    <declaration>
+
+        <field>
+            <name>id</name>
+            <type>integer</type>
+            <notnull>true</notnull>
+            <autoincrement>true</autoincrement>
+        </field>
+
+        <field>
+            <name>username</name>
+            <type>text</type>
+            <length>32</length>
+            <notnull>true</notnull>
+        </field>
+
+        <field>
+            <name>passwd</name>
+            <type>text</type>
+            <length>64</length>
+            <notnull>true</notnull>
+        </field>
+
+        <field>
+            <name>superadmin</name>
+            <type>boolean</type>
+            <notnull>true</notnull>
+            <default>false</default>
+        </field>
+
+        <field>
+            <name>user_type</name>
+            <type>integer</type>
+            <length>1</length>
+            <default>2</default>
+        </field>
+
+        <field>
+            <name>validation_key</name>
+            <type>text</type>
+            <length>48</length>
+        </field>
+
+        <field>
+            <name>nickname</name>
+            <type>text</type>
+            <length>128</length>
+        </field>
+
+        <field>
+            <name>email</name>
+            <type>text</type>
+            <length>128</length>
+            <notnull>true</notnull>
+        </field>
+
+        <field>
+            <name>new_email</name>
+            <type>text</type>
+            <length>128</length>
+        </field>
+
+        <field>
+            <name>fname</name>
+            <type>text</type>
+            <length>128</length>
+        </field>
+
+        <field>
+            <name>lname</name>
+            <type>text</type>
+            <length>128</length>
+        </field>
+
+        <field>
+            <name>gender</name>
+            <type>integer</type>
+            <length>1</length>
+            <default>0</default>
+        </field>
+
+        <field>
+            <name>dob</name>
+            <type>timestamp</type>
+        </field>
+
+        <field>
+            <name>url</name>
+            <type>text</type>
+            <length>255</length>
+        </field>
+
+        <field>
+            <name>timezone</name>
+            <type>text</type>
+            <length>5</length>
+        </field>
+
+        <field>
+            <name>language</name>
+            <type>text</type>
+            <length>5</length>
+        </field>
+
+        <field>
+            <name>theme</name>
+            <type>text</type>
+            <length>24</length>
+        </field>
+
+        <field>
+            <name>editor</name>
+            <type>text</type>
+            <length>24</length>
+        </field>
+
+        <field>
+            <name>last_login</name>
+            <type>timestamp</type>
+        </field>
+
+        <field>
+            <name>createtime</name>
+            <type>timestamp</type>
+        </field>
+
+        <field>
+            <name>updatetime</name>
+            <type>timestamp</type>
+        </field>
+
+        <field>
+            <name>change_passwd</name>
+            <type>boolean</type>
+            <notnull>true</notnull>
+            <default>true</default>
+        </field>
+
+        <field>
+            <name>never_expire</name>
+            <type>boolean</type>
+            <notnull>true</notnull>
+            <default>true</default>
+        </field>
+
+        <field>
+            <name>bad_passwd_count</name>
+            <type>integer</type>
+            <length>2</length>
+            <default>0</default>
+        </field>
+
+        <field>
+            <name>concurrent_logins</name>
+            <type>integer</type>
+            <length>2</length>
+            <default>0</default>
+        </field>
+
+        <field>
+            <name>last_access</name>
+            <type>integer</type>
+            <length>16</length>
+            <default>0</default>
+        </field>
+
+        <field>
+            <name>enabled</name>
+            <type>boolean</type>
+            <notnull>true</notnull>
+            <default>true</default>
+        </field>
+
+        <index>
+            <name><variable>table_prefix</variable>users_username</name>
+            <unique>true</unique>
+            <field>
+                <name>username</name>
+            </field>
+        </index>
+
+        <index>
+            <name><variable>table_prefix</variable>users_email</name>
+            <field>
+                <name>email</name>
+            </field>
+        </index>
+
+
+    </declaration>
+ </table>
+
+ <table>
+    <name><variable>table_prefix</variable>groups</name>
+    <declaration>
+
+        <field>
+            <name>id</name>
+            <type>integer</type>
+            <notnull>true</notnull>
+            <autoincrement>true</autoincrement>
+        </field>
+
+        <field>
+            <name>name</name>
+            <type>text</type>
+            <length>32</length>
+            <notnull>true</notnull>
+        </field>
+
+        <field>
+            <name>title</name>
+            <type>text</type>
+            <length>255</length>
+        </field>
+
+        <field>
+            <name>description</name>
+            <type>text</type>
+        </field>
+
+        <field>
+            <name>removable</name>
+            <type>boolean</type>
+            <notnull>true</notnull>
+            <default>true</default>
+        </field>
+
+        <field>
+            <name>enabled</name>
+            <type>boolean</type>
+            <notnull>true</notnull>
+            <default>true</default>
+        </field>
+
+        <index>
+            <name><variable>table_prefix</variable>groups_name</name>
+            <unique>true</unique>
+            <field>
+                <name>name</name>
+            </field>
+        </index>
+
+    </declaration>
+ </table>
+
+ <table>
+     <name><variable>table_prefix</variable>users_groups</name>
+     <declaration>
+
+         <field>
+             <name>user_id</name>
+             <type>integer</type>
+             <notnull>true</notnull>
+         </field>
+
+         <field>
+             <name>group_id</name>
+             <type>integer</type>
+             <notnull>true</notnull>
+         </field>
+
+         <index>
+             <name><variable>table_prefix</variable>users_groups_ui</name>
+             <field>
+                 <name>user_id</name>
+             </field>
+         </index>
+
+         <index>
+             <name><variable>table_prefix</variable>users_groups_gi</name>
+             <field>
+                 <name>group_id</name>
+             </field>
+         </index>
+
+     </declaration>
+ </table>
+
+</database>

Modified: trunk/jaws/html/gadgets/Users/schema/schema.xml
===================================================================
--- trunk/jaws/html/gadgets/Users/schema/schema.xml	2012-08-05 22:24:06 UTC (rev 13297)
+++ trunk/jaws/html/gadgets/Users/schema/schema.xml	2012-08-06 19:55:48 UTC (rev 13298)
@@ -36,13 +36,6 @@
         </field>
 
         <field>
-            <name>user_type</name>
-            <type>integer</type>
-            <length>1</length>
-            <default>2</default>
-        </field>
-
-        <field>
             <name>validation_key</name>
             <type>text</type>
             <length>48</length>
@@ -100,7 +93,7 @@
         <field>
             <name>timezone</name>
             <type>text</type>
-            <length>5</length>
+            <length>48</length>
         </field>
 
         <field>
@@ -122,21 +115,6 @@
         </field>
 
         <field>
-            <name>last_login</name>
-            <type>timestamp</type>
-        </field>
-
-        <field>
-            <name>createtime</name>
-            <type>timestamp</type>
-        </field>
-
-        <field>
-            <name>updatetime</name>
-            <type>timestamp</type>
-        </field>
-
-        <field>
             <name>change_passwd</name>
             <type>boolean</type>
             <notnull>true</notnull>
@@ -144,13 +122,6 @@
         </field>
 
         <field>
-            <name>never_expire</name>
-            <type>boolean</type>
-            <notnull>true</notnull>
-            <default>true</default>
-        </field>
-
-        <field>
             <name>bad_passwd_count</name>
             <type>integer</type>
             <length>2</length>
@@ -172,12 +143,35 @@
         </field>
 
         <field>
+            <name>logon_hours</name>
+            <type>text</type>
+            <length>168</length>
+            <fixed>true</fixed>
+            <default><variable>logon_hours</variable></default>
+        </field>
+
+        <field>
+            <name>expire_date</name>
+            <type>timestamp</type>
+        </field>
+
+        <field>
             <name>enabled</name>
             <type>boolean</type>
             <notnull>true</notnull>
             <default>true</default>
         </field>
 
+        <field>
+            <name>createtime</name>
+            <type>timestamp</type>
+        </field>
+
+        <field>
+            <name>updatetime</name>
+            <type>timestamp</type>
+        </field>
+
         <index>
             <name><variable>table_prefix</variable>users_username</name>
             <unique>true</unique>
@@ -193,7 +187,6 @@
             </field>
         </index>
 
-
     </declaration>
  </table>
 



More information about the Jaws-commits mailing list