当前位置: 首页>>代码示例>>PHP>>正文


PHP _crypt函数代码示例

本文整理汇总了PHP中_crypt函数的典型用法代码示例。如果您正苦于以下问题:PHP _crypt函数的具体用法?PHP _crypt怎么用?PHP _crypt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_crypt函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: login

 public function login($username, $password)
 {
     $this->username = protectVar($username);
     $this->password = _crypt($password);
     $query = $this->sql->sendQuery("SELECT * FROM " . __PREFIX__ . "user WHERE username = '" . $this->username . "' LIMIT 1");
     while ($res = mysql_fetch_array($query)) {
         if ($this->username == $res['username'] && $this->password == $res['password']) {
             setcookie("id", $res['id'], time() + 3600 * 24, "/");
             setcookie("username", $this->username, time() + 3600 * 24, "/");
             setcookie("password", $this->password, time() + 3600 * 24, "/");
             if ($res['timesession'] == 0) {
                 $id = $res['id'];
                 $datetime = date("dmyGi");
                 setcookie("TimeSession", $datetime, time() + 3600 * 24, "/");
                 $this->sql->sendQuery("UPDATE " . __PREFIX__ . "user SET timesession = '" . $datetime . "' WHERE id = '" . (int) $id . "'");
             } else {
                 setcookie("TimeSession", $res['timesession'], time() + 3600 * 24, "/");
             }
             if (!empty($res['clickup'])) {
                 setcookie("clickUp", $res['clickup'], time() + 3600 * 24, "/");
             }
             return TRUE;
         } else {
             return FALSE;
         }
     }
 }
开发者ID:KinG-InFeT,项目名称:DxBB,代码行数:27,代码来源:user.class.php

示例2: AuthUserHtPasswd

function AuthUserHtPasswd($pagename, $id, $pw, $pwlist)
{
    foreach ((array) $pwlist as $f) {
        $fp = fopen($f, "r");
        if (!$fp) {
            continue;
        }
        while ($x = fgets($fp, 1024)) {
            $x = rtrim($x);
            list($i, $c, $r) = explode(':', $x, 3);
            if ($i == $id && _crypt($pw, $c) == $c) {
                fclose($fp);
                return true;
            }
        }
        fclose($fp);
    }
    return false;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:19,代码来源:authuser.php

示例3: AuthenticateUser

        if (crypt($pw, $c) == $c) {
            AuthenticateUser($id);
            return;
        }
    }
}
# Now lets check any .htpasswd file equivalents
foreach ((array) $AuthUser['htpasswd'] as $f) {
    $fp = fopen($f, "r");
    if (!$fp) {
        continue;
    }
    while ($x = fgets($fp, 1024)) {
        $x = rtrim($x);
        list($i, $c, $r) = explode(':', $x, 3);
        if ($i == $id && _crypt($pw, $c) == $c) {
            fclose($fp);
            AuthenticateUser($id);
            return;
        }
    }
    fclose($fp);
}
# LDAP authentication.
if ($AuthUser['ldap'] && preg_match('!ldap://([^:]+)(?::(\\d+))?/(.+)$!', $AuthUser['ldap'], $match)) {
    list($z, $server, $port, $path) = $match;
    list($basedn, $attr, $sub) = explode('?', $path);
    if (!$port) {
        $port = 389;
    }
    if (!$attr) {
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:31,代码来源:authuser.php

示例4: session_start

<?php

session_start();
//import libraries
require_once '../_librerias/php/funciones.php';
require_once '../_librerias/php/conexiones.php';
require_once "../_librerias/php/class/owl-login.php";
error_reporting(E_ERROR);
$vConex = conexSys();
$login = new Login();
$login->setURLredirect("/master.php");
$login->execute(function ($user, $password) {
    global $login, $vConex;
    $password = _crypt($password);
    $Q_U = "\n    SELECT \n    AdminCod, \n    Nombres \n    FROM administradores\n    WHERE Usuario = '{$user}' \n    AND Contrasena = '{$password}'";
    $ObjU = fetchOne($Q_U, $vConex);
    if ($ObjU) {
        $_SESSION["master_access"] = $ObjU->AdminCod;
        $login->success();
    } else {
        $login->breaker("El usuario y/o contraseña son inválidos");
    }
});
开发者ID:dice9030,项目名称:GestionLogistico,代码行数:23,代码来源:se_login_master.php

示例5: decrypt

function decrypt($input) {
	return _crypt(_base64_decode($input),true);
}
开发者ID:4otaku,项目名称:4otaku,代码行数:3,代码来源:metafunctions.php

示例6: add


//.........这里部分代码省略.........
				$video_worker = new Transform_Video($video_link);
				$video_object = $video_worker->disable_nico()->get_html();

				if (empty($video_object)) {
					$this->add_res(
						'Извините, видеосервиса для ссылки '.
						'('.$add_video.') нет в нашей базе, '.
						'либо с вашей ссылкой что-то не так.'
					,true);
					continue;
				}
				$content['video'][] = array(
					'link' => $video_link,
					'object' => $video_object,
					'service_id' => $video_worker->get_id(),
					'aspect' => $video_worker->get_aspect(),
				);
				$count_content++;
			}
		}

		$text = obj::transform('text')->wakaba(query::$post['text']);

		$is_thread = (bool) empty(query::$post['id']);

		if ($is_thread + empty($content) + empty($text) <= 1) {

			$trip = preg_split('/(?<!&)#/', query::$post['user']);
			$user = array_shift($trip);
//			$user = preg_replace('/#.*$/','',$user);
			$trip = array_slice($trip,0,3);

			$tripcode = $trip[0] ? $this->trip($trip[0]) : '';
			$tripcode .= $trip[1] || $trip[2] ? '!'.$this->trip(_crypt($trip[1].$trip[2])) : '';

			if (trim($user) && $user != $def['user']['name']) {
				$cookie->inner_set('user.name',$user);
			}
			if (!empty($trip)) {
				$cookie->inner_set('user.trip',implode('#',$trip));
			} else {
				$cookie->inner_set('user.trip','');
			}

			if ($is_thread) {
				$categories = (array) query::$post['category'];

				$board_categories = obj::db()->sql('
					SELECT id, alias from category
					WHERE locate("|board|",area)
					ORDER BY id
				', 'alias');
				$insert_categories = array();

				$limit = $this->max_threads_in_board - 1;
				$to_flush = array();
				foreach ($categories as $category) {
					if (!array_key_exists($category, $board_categories)) {
						continue;
					}

					if (!in_array($category, $this->storing_boards)) {
						$to_flush = array_merge(
							$to_flush,
							(array) obj::db()->sql('
								SELECT board.id, board_category.category_id
开发者ID:4otaku,项目名称:4otaku,代码行数:67,代码来源:board.php


注:本文中的_crypt函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。