/** * Static function to simply autenticate users. * Can be used for other purposes. * @param string $login the linux username * @param string $password password * @access public * @return bool - true if login and password is right */ public static function autenticate($login, $password) { self::$username = $login; $process = new Process("su " . escapeshellarg($login)); usleep(500000); $process->put($password); $process->put(chr(13)); usleep(500000); return (bool) (!$process->close()); }