Commits

christiansalazar committed b641bab Merge

Merge branch 'master' of ssh://bitbucket.org/christiansalazarh/cruge

  • Participants
  • Parent commits dcc9472, 9e4a2f6

Comments (0)

Files changed (3)

File components/CrugeAuthManager.php

         //		mapping: "action_ui_" cambiara por "action_cruge_ui_"
         //
         $itemname = $this->_mapAction($itemname, $this->mapping);
-
+        
         // ejemplo, recibe: action_site_index
         // lo descompone en array('site/index', ..$args..)
         $e = explode('_', $itemname);
             $controllerName = $e[1];
             $actionName = $e[2];
             $a = array();
-            $a[] = $controllerName . "/" . $actionName;
+            $a[] = "/" . $controllerName . "/" . $actionName;
             foreach ($args as $k => $v) {
                 $a[$k] = $v;
             }
             $controllerName = $e[2];
             $actionName = $e[3];
             $a = array();
-            $a[] = $moduleName . '/' . $controllerName . "/" . $actionName;
+            $a[] = "/".$moduleName . '/' . $controllerName . "/" . $actionName;
             foreach ($args as $k => $v) {
                 $a[$k] = $v;
             }
         // y que son menu items, pero que no son sub menu items
         $r1 = array();
         foreach ($itemArray as $item) {
-            if ($this->isTaskMenuItem($item)
-                && !$this->isTaskSubMenuItem($item)
-            ) {
+            if ($this->isTaskMenuItem($item) && !$this->isTaskSubMenuItem($item)) {
                 $r1[] = $item;
             }
         }

File components/CrugeUi.php

         );
     }
 
+    /*
+		una utilidad para usar una extension como EMenu para mostrar menues
+		verticales.
+		$this->widget('EMenu', array(
+			'theme'=>'adobe',
+			'items'=>Yii::app()->user->ui->adminItemsAlternative
+		));
+    */
+    public function getAdminItemsAlternative()
+    {
+        return array(
+            array('label' => CrugeTranslator::t('admin', 'User Manager'),'items'=>array(
+				array(
+					'label' => CrugeTranslator::t('admin', 'Update Profile')
+				,
+					'url' => $this->getEditProfileUrl()
+				),
+				array(
+					'label' => CrugeTranslator::t('admin', 'Create User')
+				,
+					'url' => $this->getUserManagementCreateUrl()
+				),
+				array(
+					'label' => CrugeTranslator::t('admin', 'Manage Users')
+				,
+					'url' => $this->getUserManagementAdminUrl()
+				)
+			)),
+            array('label' => CrugeTranslator::t('admin', 'Custom Fields'),'items'=>array(
+				array(
+					'label' => CrugeTranslator::t('admin', 'List Profile Fields')
+				,
+					'url' => $this->getFieldsAdminListUrl()
+				),
+				array(
+					'label' => CrugeTranslator::t('admin', 'Create Profile Field')
+				,
+					'url' => $this->getFieldsAdminCreateUrl()
+				)
+			)),
+            array('label' => CrugeTranslator::t('admin', 'Roles and Assignments'),'items'=>array(
+				array(
+					'label' => CrugeTranslator::t('admin', 'Roles')
+				,
+					'url' => $this->getRbacListRolesUrl()
+				),
+				array(
+					'label' => CrugeTranslator::t('admin', 'Tasks')
+				,
+					'url' => $this->getRbacListTasksUrl()
+				),
+				array(
+					'label' => CrugeTranslator::t('admin', 'Operations')
+				,
+					'url' => $this->getRbacListOpsUrl()
+				),
+				array(
+					'label' => CrugeTranslator::t('admin', 'Assign Roles to Users')
+				,
+					'url' => $this->getRbacUsersAssignmentsUrl()
+				),
+			)),
+            array('label' => CrugeTranslator::t('admin', 'System'),'items'=>array(
+				array(
+					'label' => CrugeTranslator::t('admin', 'Sessions')
+				,
+					'url' => $this->getSessionAdminUrl()
+				),
+				array(
+					'label' => CrugeTranslator::t('admin', 'System Variables')
+				,
+					'url' => $this->getSystemUpdateUrl()
+				),
+			)),
+        );
+    }
+
+
     /*	acumula los errores obtenidos durante el request para su posterior visualizacion con displayErrorConsole
 
         este metodo es llamado desde CrugeWebUser::checkAccess cuando el flag

File models/data/CrugeStoredUser.php

                 'newPassword',
                 'match'
             ,
-                'pattern' => '/^[a-zA-Z0-9@#$%]{6,20}$/'
+                'pattern' => '/^[a-zA-Z0-9@#$%\_\-\.]{6,20}$/'
             ,
                 'message' => CrugeTranslator::t(
                     'logon',