Returns whether the user uses 12 hour clock

@param string $login
@return string
336500
public function uses12HourClockForUser($login)
    {
        if ($login == 'anonymous') {
            return false;
        }

        Piwik::checkUserHasSuperUserAccessOrIsTheUser($login);

        $lang = $this->getModel()->uses12HourClock($login);

        return $lang;
    }
884226
public function voteKarmaPlus($login)
    {
        $this->checkAliasName($login);

        return $this->adapter->put(sprintf('/users/%s/vote', $login));
    }
916488
protected function get12hHour() : int
   {

      if ( $this->isAnteMeridiem() )
      {
         return $this->getHour();
      }

      if ( 0 === $this->_hours )
      {
         return 12;
      }

      if ( $this->_hours > 12 )
      {
         return $this->_hours - 12;
      }

      return $this->_hours;

   }
407228
public function findUserByLogin($login)
    {
        if ($login instanceof UserInterface) {
            return $login;
        }

        $result =   $this->userProvider->findByLogin($login);
        if ($result) {
            return $result;
        }

        $exceptionMessage   =   "A user with the login '%(login)s' cannot be found.";

        throw new UserNotFound(isprintf($exceptionMessage, compact('login')));
    }
200807
public function getIntervalLastLogin()
    {
        if (!$this->lastLogin) return '';
        $now = new \DateTime();
        $interval = $now->diff($this->lastLogin);
        if ($interval->days == 1)
            return $interval->format('%a jour');
        elseif ($interval->days > 1)
            return $interval->format('%a jours');
        elseif ($interval->h == 1)
            return $interval->format('%h heure');
        elseif ($interval->h > 1)
            return $interval->format('%h heures');
        elseif ($interval->i == 1)
            return $interval->format('%i minute');
        else
            return $interval->format('%i minutes');
    }
941841
public function setLogin($login)
    {
        $this->login = (string)$login;
        $this->ip    = null;
        $this->port  = null;
        return $this;
    }
520532
public function getUser($login)
    {
        $this->checkAliasName($login);

        return $this->adapter->get(sprintf('/users/%s', $login));
    }
681853
public function isLoginTokenExpired($user) {
        $startTime = strtotime($user->login_token_created_at);
        $now = strtotime(Carbon::now());
        // The time difference is in seconds, we want in minutes
        $timeDiff = ($now - $startTime)/60;
        $minutes2faFormIsLive = config('lasallecmstokenbasedlogin.token_login_minutes_token_is_live');
        if ($timeDiff > $minutes2faFormIsLive) {
            // Login token has expired
            return true;
        }
        return false;
    }
49056
public static function isValidTime($time)
    {
        if (preg_match('^(0|1|2)[0-9]([:](0|1|2|3|4|5)[0-9]){2}$', $time)) {
            $hour   = (int)substr($time, 0, 2);
            $minute = (int)substr($time, 3, 2);
            $second = (int)substr($time, 6, 2);
            if ($hour < 24 && $minute < 60 && $second < 60) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
510000
public function signUp($login)
	{
		$stmntSingup = $this->db->prepare("
			INSERT INTO login SET
				username = ?,
				email = ?,
				password = ?,
				registeredby = ?,
				salt = ?,
				confirmed = NULL,
				active = ?,
				lastlogin = NULL,
				wronglogins = 0,
				token = ?,
				tokentime = ?
		");

		$salt = $this->generateSalt();

		try {
			$this->db->beginTransaction();

			$userID = $this->db->insert($stmntSingup, array(
				isset($login->username)?$login->username:null,
				$login->email,
				isset($login->password)?$this->encryptPassword($login->password, $salt):null,
				isset($login->registeredBy)?$login->registeredBy:null,
				$salt,
				isset($login->active)?$login->active:0,
				isset($login->token)?$login->token:null,
				isset($login->token)?date('Y-m-d H:i:s'):null
			));

			if(!isset($login->rightGroups) || !is_array($login->rightGroups)) {
				$this->db->commit();
				return $userID;
			}

			$stmntRghtGrps = $this->db->prepare("
				INSERT INTO login_has_rightgroup SET
					 loginIDFK = ?
					,rightgroupIDFK = ?
					,datefrom = NOW() 
			");

			foreach($login->rightGroups as $rg) {
				$this->db->insert($stmntRghtGrps, array($userID, $rg));
			}

			$this->db->commit();

			return $userID;
		} catch(\Exception $e) {
			$this->db->rollBack();

			throw $e;
		}
	}
979875
protected function getSTSUrl( $login ) {
        $content = [ 'login' => $this->settings->username, 'xml' => 1 ];

        $cURLHandle = curl_init();
        curl_setopt( $cURLHandle, CURLOPT_URL, 'https://login.microsoftonline.com/GetUserRealm.srf' );
        curl_setopt( $cURLHandle, CURLOPT_RETURNTRANSFER, 1 );
        curl_setopt( $cURLHandle, CURLOPT_TIMEOUT, Client::getConnectorTimeout() );

        if ( $this->settings->caPath ) {
            curl_setopt( $cURLHandle, CURLOPT_CAINFO, $this->settings->caPath );
        }

        if ( $this->settings->ignoreSslErrors ) {
            curl_setopt( $cURLHandle, CURLOPT_SSL_VERIFYPEER, 0 );
            curl_setopt( $cURLHandle, CURLOPT_SSL_VERIFYHOST, 0 );
        }

        curl_setopt( $cURLHandle, CURLOPT_SSLVERSION, defined( 'CURL_SSLVERSION_TLSv1_2' )? CURL_SSLVERSION_TLSv1_2 : 6 );

        if( $this->settings->proxy ) {
          curl_setopt( $cURLHandle, CURLOPT_PROXY, $this->settings->proxy );
        }

        curl_setopt( $cURLHandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );
        curl_setopt( $cURLHandle, CURLOPT_HTTPHEADER, [ 'Content-Type: application/x-www-form-urlencoded' ] );
        curl_setopt( $cURLHandle, CURLOPT_POST, 1 );
        curl_setopt( $cURLHandle, CURLOPT_POSTFIELDS, http_build_query( $content ) );
        curl_setopt( $cURLHandle, CURLOPT_FOLLOWLOCATION, true ); // follow redirects
        curl_setopt( $cURLHandle, CURLOPT_POSTREDIR, 7 ); // 1 | 2 | 4 (301, 302, 303 redirects mask)
        curl_setopt( $cURLHandle, CURLOPT_HEADER, false );

        /* Execute the cURL request, get the XML response */
        $responseXML = curl_exec( $cURLHandle );

        /* Check for cURL errors */
        if ( curl_errno( $cURLHandle ) != CURLE_OK ) {
            throw new \Exception( 'cURL Error: ' . curl_error( $cURLHandle ) );
        }
        /* Check for HTTP errors */
        $httpResponse = curl_getinfo( $cURLHandle, CURLINFO_HTTP_CODE );
        $curlInfo = curl_getinfo( $cURLHandle );
        $curlErrNo = curl_errno( $cURLHandle );
        curl_close( $cURLHandle );

        if ( empty( $responseXML ) ) {
            throw new \Exception( 'Empty response from the GetUserRealm endpoint.' );
        }

        if ( strpos( $responseXML, '<IsFederatedNS>true</IsFederatedNS>' ) === false ) {
            return null;
        }

        preg_match( '~<STSAuthURL>(.*?)</STSAuthURL>~', $responseXML, $stsMatch );
        $authUri = $stsMatch[1];

        return preg_replace( '~^https?://(.*?)/.*$~', 'https://$1/adfs/services/trust/13/usernamemixed', $authUri );
    }
274982
public function getUserCompanies($login)
    {
        $this->checkAliasName($login);

        return $this->adapter->get(sprintf('/users/%s/companies', $login));
    }
1241930
static public function isValidTime($hour, $min, $sec, $hs24 = true)
    {
        if ($hs24 && ($hour < 0 || $hour > 23) || !$hs24 && ($hour < 1 || $hour > 12)) return false;
        if ($min > 59 || $min < 0) return false;
        if ($sec > 59 || $sec < 0) return false;
        return true;
    }
486231
public function getLoginGroupName($login)
    {
        foreach ($this->config as $groupName => $group) {
            if (in_array($login, $group['logins']->getRawValue())) {
                return $groupName;
            }
        }

        return null;
    }
540970
function (hour) {
      if (this.settings.hour === 12) {
        switch (hour) {
          case 0:
          case 24:
            hour = '12am';
            break;
          case 12:
            hour = '12pm';
            break;
          default:
            if (hour > 12) {
              hour = (hour - 12) + 'pm';
            } else {
              hour += 'am';
            }
        }
      } else {
        if (hour >= 24) {
          hour = 0;
        }

        if (hour < 10) {
          hour = '0' + hour;
        }
        hour += ':00';
      }

      return hour;
    }
582618
private function getLoggerTime()
    {
        if (! static::$timezone) {
            static::$timezone = new \DateTimeZone(date_default_timezone_get() ? : 'UTC');
        }

        // php7.1+ always has microseconds enabled, so we do not need this hack
        if ($this->microsecondTimestamps && PHP_VERSION_ID < 70100) {
            $ts = \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone);
        } else {
            $ts = new \DateTime(null, static::$timezone);
        }

        $ts->setTimezone(static::$timezone);
        return $ts;
    }
449907
public function removeByLoginField($login)
    {
        $user = $this->getByLoginField($login);

        if ($user !== null) {
            return $this->removeUserById($user->getUserid());
        }

        return false;
    }