ProfileAction Klassenreferenz

Klassendiagramm für ProfileAction:

Inheritance graph
base refererrect $classAction.html 6,7 190,463

Aufstellung aller Elemente

Öffentliche Methoden

 ProfileAction ()
 saveprofile ()
 pwchange ()
 mail ()
 mailcode ()
 confirmmail ()
 savemail ()
 savepw ()
 edit ()
 groups ()
 checkMenu ($name)

Öffentliche Attribute

 $user
 $defaultSubAction = 'edit'


Ausführliche Beschreibung

Definiert in Zeile 30 der Datei ProfileAction.class.php.


Dokumentation der Elementfunktionen

ProfileAction::checkMenu ( name  ) 

Parameter:
String $name Menüpunkt
Rückgabe:
boolean

Erneute Implementation von Action.

Definiert in Zeile 195 der Datei ProfileAction.class.php.

Benutzt $conf.

00196      {
00197           global $conf;
00198           
00199           switch( $name )
00200           {
00201                case 'pwchange':
00202                     return     @$conf['security']['auth']['type'] == 'database'
00203                            && !@$conf['security']['auth']['userdn'];
00204                     
00205                default:
00206                     return true;
00207           }    
00208      }

ProfileAction::confirmmail (  ) 

Definiert in Zeile 113 der Datei ProfileAction.class.php.

00114      {
00115      }

ProfileAction::edit (  ) 

Definiert in Zeile 171 der Datei ProfileAction.class.php.

Benutzt Action::setTemplateVar() und Action::setTemplateVars().

00172      {
00173           $this->setTemplateVars( $this->user->getProperties() );
00174 
00175           $this->setTemplateVar( 'allstyles',$this->user->getAvailableStyles() );
00176      }

ProfileAction::groups (  ) 

Anzeige aller Gruppen des angemeldeten Benutzers.

Definiert in Zeile 184 der Datei ProfileAction.class.php.

Benutzt Action::setTemplateVar().

00185      {
00186           $this->setTemplateVar( 'groups',$this->user->getGroups() );
00187      }

ProfileAction::mail (  ) 

Definiert in Zeile 70 der Datei ProfileAction.class.php.

00071      {
00072      }

ProfileAction::mailcode (  ) 

Definiert in Zeile 76 der Datei ProfileAction.class.php.

Benutzt Action::addNotice(), Action::addValidationError(), Action::callSubAction(), Action::getRequestVar() und Session::set().

00077      {
00078           srand ((double)microtime()*1000003);
00079           $code = rand();
00080           $newMail = $this->getRequestVar('mail');
00081 
00082           if   ( empty($newMail) )
00083           {
00084                // Bestätigungscode stimmt nicht.
00085                $this->addValidationError('mail');
00086                return;
00087           }
00088           else
00089           {
00090                Session::set('mailChangeCode',$code   );
00091                Session::set('mailChangeMail',$newMail);
00092                
00093                // E-Mail an die neue Adresse senden.
00094                $mail = new Mail( $newMail,'mail_change_code' );
00095                $mail->setVar('code',$code                 );
00096                $mail->setVar('name',$this->user->getName());
00097                
00098                if   ( $mail->send() )
00099                {
00100                     $this->addNotice('user',$this->user->name,'mail_sent',OR_NOTICE_OK); // Meldung
00101                }
00102                else
00103                {
00104                     $this->addNotice('user',$this->user->name,'mail_not_sent',OR_NOTICE_ERROR,array(),$mail->error); // Meldung
00105                     $this->callSubAction('mail');
00106                     return;
00107                }
00108           }
00109      }

ProfileAction::ProfileAction (  ) 

Definiert in Zeile 35 der Datei ProfileAction.class.php.

Benutzt Session::getUser().

00036      {
00037           $this->user = Session::getUser();
00038      }

ProfileAction::pwchange (  ) 

Definiert in Zeile 64 der Datei ProfileAction.class.php.

00065      {
00066      }

ProfileAction::savemail (  ) 

Definiert in Zeile 119 der Datei ProfileAction.class.php.

Benutzt Action::addNotice(), Action::addValidationError(), Action::callSubAction(), Session::get() und Action::getRequestVar().

00120      {
00121           $sessionCode       = Session::get('mailChangeCode');
00122           $newMail           = Session::get('mailChangeMail');
00123           $inputRegisterCode = $this->getRequestVar('code');
00124           
00125           if   ( $sessionCode == $inputRegisterCode )
00126           {
00127                // Bestätigungscode stimmt überein.
00128                // E-Mail-Adresse ändern.     
00129                $this->user->mail = $newMail;
00130                $this->user->save();
00131                
00132                $this->addNotice('user',$this->user->name,'SAVED',OR_NOTICE_OK);
00133           }
00134           else
00135           {
00136                // Bestätigungscode stimmt nicht.
00137                $this->addValidationError('code','code_not_match');
00138                $this->callSubAction('confirmmail');
00139           }
00140           
00141      }

ProfileAction::saveprofile (  ) 

Abspeichern des Profiles

Definiert in Zeile 44 der Datei ProfileAction.class.php.

Benutzt Action::addNotice(), Action::addValidationError(), Action::callSubAction() und Action::getRequestVar().

00045      {
00046           $this->user->fullname = $this->getRequestVar('fullname');
00047           $this->user->tel      = $this->getRequestVar('tel'     );
00048           $this->user->desc     = $this->getRequestVar('desc'    );
00049           $this->user->style    = $this->getRequestVar('style'   );
00050           
00051           if   ( !empty($this->user->fullname) )
00052           {
00053                $this->user->save();
00054                $this->addNotice('user',$this->user->name,'SAVED','ok');
00055           }
00056           else
00057           {
00058                $this->addValidationError('fullname');
00059                $this->callSubAction('edit');
00060           }
00061      }

ProfileAction::savepw (  ) 

Definiert in Zeile 145 der Datei ProfileAction.class.php.

Benutzt Action::addNotice(), Action::addValidationError(), Action::callSubAction() und Action::getRequestVar().

00146      {
00147           if   ( ! $this->user->checkPassword( $this->getRequestVar('act_password') ) )
00148           {
00149                $this->addValidationError('act_password');
00150                $this->callSubAction('pwchange');
00151           }
00152           elseif    ( $this->getRequestVar('password1') == '' )
00153           {
00154                $this->addValidationError('password1');
00155                $this->callSubAction('pwchange');
00156           }
00157           elseif ( $this->getRequestVar('password1') != $this->getRequestVar('password2') )
00158           {
00159                $this->addValidationError('password2','PASSWORDS_DO_NOT_MATCH');
00160                $this->callSubAction('pwchange');
00161           }
00162           else
00163           {
00164                $this->user->setPassword( $this->getRequestVar('password1') );
00165                $this->addNotice('user',$this->user->name,'SAVED','ok');
00166           }
00167      }


Dokumentation der Datenelemente

ProfileAction::$defaultSubAction = 'edit'

Definiert in Zeile 33 der Datei ProfileAction.class.php.

ProfileAction::$user

Definiert in Zeile 32 der Datei ProfileAction.class.php.


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei:

Erzeugt am Thu May 14 00:55:50 2009 für OpenRat von  doxygen 1.5.8