openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 5126a204a68bc2956605266d12a04f8f91ec8ed8
parent 13e2a487226937d5ca78d131e6c405ed2f1fa315
Author: Jan Dankert <devnull@localhost>
Date:   Sun,  6 Nov 2011 23:02:35 +0100

Neu: Perspektive für Benutzerprofil.

Diffstat:
action/Action.class.php | 17+++++++++++++++++
action/ProfileAction.class.php | 10+++++-----
action/ProfileAction.ini.php | 18+++++-------------
action/StartAction.class.php | 11+++++++++++
action/StartAction.ini.php | 3+++
language/de.ini.php | 22++++++++++------------
themes/default/layout/perspective/profile.ini.php | 8++++++++
themes/default/layout/perspective/profile.php | 10++++++++++
themes/default/templates/profile/groups.tpl.src.php | 14--------------
themes/default/templates/profile/memberships.tpl.src.php | 14++++++++++++++
themes/default/templates/profile/pw.tpl.src.php | 26++++++++++++++++++++++++++
themes/default/templates/profile/pwchange.tpl.src.php | 26--------------------------
12 files changed, 109 insertions(+), 70 deletions(-)

diff --git a/action/Action.class.php b/action/Action.class.php @@ -543,6 +543,21 @@ class Action /** + * Stellt klar, dass ein Administrator angemeldet sein muss. + */ + protected function requireAdmin() + { + if ( ! $this->userIsAdmin() ) + { + Logger::warn('User has no administration privileges'); + Http::notAuthorized( lang('SESSION_EXPIRED'),'administration privileges required' ); + $do->templateVars['error'] = 'administration privileges required'; + exit; + } + } + + + /** * Ermitteln des Benutzerobjektes aus der Session * @return User */ @@ -643,6 +658,8 @@ class Action protected function setMenu() { + return; + if (!isset($this->actionConfig[$this->subActionName]['menu'])) return; $windowMenu = array(); diff --git a/action/ProfileAction.class.php b/action/ProfileAction.class.php @@ -45,7 +45,7 @@ class ProfileAction extends Action /** * Abspeichern des Profiles */ - function saveprofile() + function editAction() { $this->user->fullname = $this->getRequestVar('fullname'); $this->user->tel = $this->getRequestVar('tel' ); @@ -130,7 +130,7 @@ class ProfileAction extends Action /** * Anzeigen einer Maske zum Ändern des Kennwortes. */ - function pwchange() + function pwView() { } @@ -225,7 +225,7 @@ class ProfileAction extends Action - function savepw() + public function pwAction() { if ( ! $this->user->checkPassword( $this->getRequestVar('act_password') ) ) { @@ -254,7 +254,7 @@ class ProfileAction extends Action /** * Anzeige aller Benutzer-Eigenschaften. */ - function edit() + function editView() { $this->setTemplateVars( $this->user->getProperties() ); @@ -267,7 +267,7 @@ class ProfileAction extends Action * Anzeige aller Gruppen des angemeldeten Benutzers. * */ - function groups() + function membershipsView() { $this->setTemplateVar( 'groups',$this->user->getGroups() ); } diff --git a/action/ProfileAction.ini.php b/action/ProfileAction.ini.php @@ -3,15 +3,16 @@ goto=edit [edit] -target=saveprofile menu=edit editable=true +write=true -[groups] +[memberships] menu=edit +write=true -[pwchange] -target=savepw +[pw] +write=true menu=edit [mail] @@ -28,15 +29,7 @@ menu=edit [savemail] goto=edit -[savepw] -goto=edit - -[saveprofile] -goto=edit - [settings] menu=edit write=true -[menu] -menu=edit,settings,pwchange,mail,groups- \ No newline at end of file diff --git a/action/StartAction.class.php b/action/StartAction.class.php @@ -848,6 +848,17 @@ class StartAction extends Action /** + * Auswaehlen des Benutzer-Profiles. + */ + function profileAction() + { + Session::set('perspective','profile'); + $this->refresh(); + } + + + + /** * Ausgeben von maschinenlesbaren Benutzerinformationen. * * Diese Funktion dient dem Single-Signon f�r fremde Anwendungen, welche diff --git a/action/StartAction.ini.php b/action/StartAction.ini.php @@ -14,6 +14,9 @@ direct=true menu=menu write=true +[profile] +write=true + [projectmenu] menu=menu clear=tree diff --git a/language/de.ini.php b/language/de.ini.php @@ -671,22 +671,20 @@ MENU_HELP_DESC=Onlinehilfe MENU_HELP=Hilfe MENU_IMPORT_DESC ="Dateien aus lokalem Dateiordner des Servers in einen Projektordner kopieren" MENU_IMPORT =Import -MENU_START_ADMINISTRATION ="Administration" -MENU_START_ADMINISTRATION_DESC ="Projektverwaltung und Benutzerverwaltung" -MENU_START_APPLICATIONS="Anwendungen" -MENU_START_APPLICATIONS_DESC="Weitere Anwendungen starten" +MENU_APPLICATIONS="Anwendungen" +MENU_APPLICATIONS_DESC="Weitere Anwendungen starten" MENU_LOGIN_LOGIN =Anmeldung MENU_INDEX_LOGOUT ="Abmelden" MENU_INDEX_LOGOUT_DESC ="Von dieser Anwendung abmelden." MENU_INDEX_MENU =Projekt auswhlen -MENU_LOGIN_PASSWORD_DESC ="Wenn Sie hier Kennwort nicht mehr wissen, knnen Sie es sich zusenden lassen." -MENU_LOGIN_PASSWORD ="Kennwort vergessen" -MENU_START_PROJECTMENU_DESC ="Whlen Sie ein Projekt aus, das Sie bearbeiten mchten" -MENU_START_PROJECTMENU ="Projekt auswhlen" -MENU_LOGIN_REGISTER_DESC ="Sie mssen registriert sein, um diese Anwendung nutzen zu knnen." -MENU_LOGIN_REGISTER ="Registrieren" -MENU_LOGIN_LOGIN =Anmelden -MENU_LOGIN_LOGIN_DESC ="Um die Anwendung zu nutzen, muessen sich sich anmelden." +MENU_PASSWORD_DESC ="Wenn Sie hier Kennwort nicht mehr wissen, knnen Sie es sich zusenden lassen." +MENU_PASSWORD ="Kennwort vergessen" +MENU_PROJECTMENU_DESC ="Whlen Sie ein Projekt aus, das Sie bearbeiten mchten" +MENU_PROJECTMENU ="Projekt auswhlen" +MENU_REGISTER_DESC ="Sie mssen registriert sein, um diese Anwendung nutzen zu knnen." +MENU_REGISTER ="Registrieren" +MENU_LOGIN =Anmelden +MENU_LOGIN_DESC ="Um die Anwendung zu nutzen, muessen sich sich anmelden." MENU_LANGUAGE_ADD_DESC =Sprache hinzufgen MENU_LANGUAGE_ADD =Hinzufgen MENU_LANGUAGE_ADVANCED_DESC=Eigenschaften der Sprache einzeln bearbeiten diff --git a/themes/default/layout/perspective/profile.ini.php b/themes/default/layout/perspective/profile.ini.php @@ -0,0 +1,8 @@ +<?php ?> + +[content] + +views = edit,settings,pw,memberships +action = profile +refreshable = false +default = edit diff --git a/themes/default/layout/perspective/profile.php b/themes/default/layout/perspective/profile.php @@ -0,0 +1,10 @@ + +<div class="container_12"> + +<div class="prefix_3 grid_6 suffix_3"> +<?php +view_header('content'); +?> +</div> + +</div> diff --git a/themes/default/templates/profile/groups.tpl.src.php b/themes/default/templates/profile/groups.tpl.src.php @@ -1,14 +0,0 @@ -dummy - window icon:user name:user_groups - row - cell - fieldset title:message:groups - if empty:groups - newline - image notice:warning - text key:NOT_FOUND - newline - newline - list list:groups value:group - text var:group - newline diff --git a/themes/default/templates/profile/memberships.tpl.src.php b/themes/default/templates/profile/memberships.tpl.src.php @@ -0,0 +1,14 @@ +dummy + window icon:user name:user_groups + row + cell + fieldset title:message:groups + if empty:groups + newline + image notice:warning + text key:NOT_FOUND + newline + newline + list list:groups value:group + text var:group + newline diff --git a/themes/default/templates/profile/pw.tpl.src.php b/themes/default/templates/profile/pw.tpl.src.php @@ -0,0 +1,25 @@ +dummy + form method:post + window icon:user name:user_profile + row + cell class:logo colspan:2 + logo name:changepassword + row + cell colspan:2 + fieldset title:message:user_act_password + label for:act_password + text text:user_password + password name:act_password + fieldset title:message:user_new_password + label for:password1 + text text:user_new_password + password name:password1 + newline + label for:password2 + text text:user_new_password_repeat + password name:password2 + row + cell colspan:2 class:act + button type:ok + + focus field:act_password+ \ No newline at end of file diff --git a/themes/default/templates/profile/pwchange.tpl.src.php b/themes/default/templates/profile/pwchange.tpl.src.php @@ -1,25 +0,0 @@ -dummy - form method:post - window icon:user name:user_profile - row - cell class:logo colspan:2 - logo name:changepassword - row - cell colspan:2 - fieldset title:message:user_act_password - label for:act_password - text text:user_password - password name:act_password - fieldset title:message:user_new_password - label for:password1 - text text:user_new_password - password name:password1 - newline - label for:password2 - text text:user_new_password_repeat - password name:password2 - row - cell colspan:2 class:act - button type:ok - - focus field:act_password- \ No newline at end of file