Location: PHPKode > projects > iF.SVNAdmin > svnadmin/actions/change_password.php
<?php
if( !defined('ACTION_HANDLING') ) {
  die("HaHa!");
}
$appEngine->forwardInvalidModule(!$appEngine->isUserEditActive());
$appEngine->checkUserAuthentication(true, ACL_MOD_USER, ACL_ACTION_CHANGEPASS);

$password = get_request_var("password");
$password2 = get_request_var("password2");
$username = get_request_var("username");

$sessionUser = $appEngine->getSessionUsername();
if ($sessionUser != NULL)
{
  if ($sessionUser != $username)
    $appEngine->checkUserAuthentication(true, ACL_MOD_USER, ACL_ACTION_CHANGEPASS_OTHER);
}

if ($username == NULL)
{
  $appTemplate->addDefine("ERROR");
  $appTemplate->addReplacement("ERRORMSG",$appTR->tr("No username given."));
}
else if ($password == NULL || $password2 == NULL)
{
  $appTemplate->addDefine("WARNING");
  $appTemplate->addReplacement("WARNINGMSG",$appTR->tr("You have to fill out all fields."));
}
else if($password != $password2)
{
  $appTemplate->addDefine("WARNING");
  $appTemplate->addReplacement("WARNINGMSG",$appTR->tr("The password's doesn't match each other."));
}
else
{
  // Ok, change password now.
  $b = $appEngine->getUserEditProvider()->changePassword($username, $password);
  if ($b)
  {
    $appEngine->getUserEditProvider()->save();
    $appTemplate->addDefine("INFO");
    $appTemplate->addReplacement("INFOMSG",$appTR->tr("Done"));
  }
  else
  {
    $appTemplate->addDefine("ERROR");
    $appTemplate->addReplacement("ERRORMSG",$appTR->tr("An unknown error occured. Check your configuration, please."));
  }
}
?>
Return current item: iF.SVNAdmin