Subversion Repositories oidplus

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. /*
  4.  * OIDplus 2.0
  5.  * Copyright 2019 Daniel Marschall, ViaThinkSoft
  6.  *
  7.  * Licensed under the Apache License, Version 2.0 (the "License");
  8.  * you may not use this file except in compliance with the License.
  9.  * You may obtain a copy of the License at
  10.  *
  11.  *     http://www.apache.org/licenses/LICENSE-2.0
  12.  *
  13.  * Unless required by applicable law or agreed to in writing, software
  14.  * distributed under the License is distributed on an "AS IS" BASIS,
  15.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16.  * See the License for the specific language governing permissions and
  17.  * limitations under the License.
  18.  */
  19.  
  20. if (explode('$',$id)[0] == 'oidplus:changepwd_ra') {
  21.         $handled = true;
  22.         $out['title'] = 'Change RA password';
  23.  
  24.         $ra_email = explode('$',$id)[1];
  25.  
  26.         if (!OIDplus::authUtils()::isRaLoggedIn($ra_email) && !OIDplus::authUtils()::isAdminLoggedIn()) {
  27.                 $out['text'] .= '<p>You need to <a href="?goto=oidplus:login">log in</a> as the requested RA <b>'.htmlentities($ra_email).'</b>.</p>';
  28.         } else {
  29.                 $out['text'] .= '<form id="raChangePasswordForm" onsubmit="return raChangePasswordFormOnSubmit();">';
  30.                 $out['text'] .= '<input type="hidden" id="email" value="'.htmlentities($ra_email).'"/><br>';
  31.                 $out['text'] .= 'Old password: <input type="password" id="old_password" value=""/><br>';
  32.                 $out['text'] .= 'New password: <input type="password" id="new_password1" value=""/><br>';
  33.                 $out['text'] .= 'Again: <input type="password" id="new_password2" value=""/><br>';
  34.                 $out['text'] .= '<input type="submit" value="Change password"></form>';
  35.         }
  36. }
  37.