original_string: public function password_expire($username) {
          $result = 0;
  
          if (!empty($this->config->expirationtime)) {
              $user = core_user::get_user_by_username($username, 'id,timecreated');
              $lastpasswordupdatetime = get_user_preferences('auth_manual_passwordupdatetime', $user->timecreated, $user->id);
              $expiretime = $lastpasswordupdatetime + $this->config->expirationtime * DAYSECS;
              $now = time();
              $result = ($expiretime - $now) / DAYSECS;
              if ($expiretime > $now) {
                  $result = ceil($result);
              } else {
                  $result = floor($result);
              }
          }
  
          return $result;
      }
code: public function password_expire($username) {
          $result = 0;
  
          if (!empty($this->config->expirationtime)) {
              $user = core_user::get_user_by_username($username, 'id,timecreated');
              $lastpasswordupdatetime = get_user_preferences('auth_manual_passwordupdatetime', $user->timecreated, $user->id);
              $expiretime = $lastpasswordupdatetime + $this->config->expirationtime * DAYSECS;
              $now = time();
              $result = ($expiretime - $now) / DAYSECS;
              if ($expiretime > $now) {
                  $result = ceil($result);
              } else {
                  $result = floor($result);
              }
          }
  
          return $result;
      }
code_tokens: public function password_expire ( $ username ) { $ result = 0 ; if ( ! empty ( $ this -> config -> expirationtime ) ) { $ user = core_user :: get_user_by_username ( $ username , 'id,timecreated' ) ; $ lastpasswordupdatetime = get_user_preferences ( 'auth_manual_passwordupdatetime' , $ user -> timecreated , $ user -> id ) ; $ expiretime = $ lastpasswordupdatetime + $ this -> config -> expirationtime * DAYSECS ; $ now = time ( ) ; $ result = ( $ expiretime - $ now ) / DAYSECS ; if ( $ expiretime > $ now ) { $ result = ceil ( $ result ) ; } else { $ result = floor ( $ result ) ; } } return $ result ; }
docstring: Return number of days to user password expires.
  
  If user password does not expire, it should return 0 or a positive value.
  If user password is already expired, it should return negative value.
  
  @param mixed $username username (with system magic quotes)
  @return integer
docstring_tokens: Return number of days to user password expires .