本文整理汇总了PHP中DB::password方法的典型用法代码示例。如果您正苦于以下问题:PHP DB::password方法的具体用法?PHP DB::password怎么用?PHP DB::password使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB
的用法示例。
在下文中一共展示了DB::password方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Scores
public function Scores($userid)
{
\DB::$user = 'euro2016';
\DB::$password = 'hllau860509';
\DB::$dbName = 'Euro2016';
$adminscore = \DB::query("select * from Scores where UserID = 4");
$NoOfMatches = \DB::count();
$userscore = \DB::query("select * from Scores where UserID = %i", $userid);
$totalscore = 0;
foreach ($adminscore as $ascore) {
foreach ($userscore as $uscore) {
if ($uscore['MatchID'] == $ascore['MatchID']) {
if ($uscore['CountryHome'] == $ascore['CountryHome'] && $uscore['CountryAway'] == $ascore['CountryAway']) {
$totalscore += 3;
} else {
if ($uscore['CountryHome'] > $uscore['CountryAway'] && $ascore['CountryHome'] > $ascore['CountryAway']) {
$totalscore += 1;
} else {
if ($uscore['CountryHome'] < $uscore['CountryAway'] && $ascore['CountryHome'] < $ascore['CountryAway']) {
$totalscore += 1;
} else {
if ($uscore['CountryHome'] == $uscore['CountryAway'] && $ascore['CountryHome'] == $ascore['CountryAway']) {
$totalscore += 1;
}
}
}
}
}
}
}
return $totalscore;
}
示例2: connect
public static function connect(array $connect)
{
self::$host = $connect['host'];
self::$username = $connect['username'];
self::$password = $connect['password'];
self::$database = $connect['database'];
}
示例3:
function __construct()
{
self::$host = Config::get('db_host');
self::$db = Config::get('db_name');
self::$user = Config::get('db_user');
self::$password = Config::get('db_pass');
parent::__construct(self::$host, self::$user, self::$password, self::$db);
}
示例4: __construct
public function __construct($config)
{
$this->eskimo = new Eskimo();
DB::$user = $config['db_user'];
DB::$password = $config['db_password'];
DB::$dbName = $config['db_name'];
DB::$encoding = 'utf8';
//DB::debugMode();
}
示例5: init
public static function init()
{
self::$host = Config::$MYSQL_HOST;
self::$user = Config::$MYSQL_USER;
self::$password = Config::$MYSQL_PASS;
self::$db_name = Config::$DATABASE;
self::$desc = mysqli_connect(self::$host, self::$user, self::$password, self::$db_name) or die("Unable to connect to MySQL");
mysqli_set_charset(self::$desc, self::$charset);
}
示例6: connect
/**
* Connection
*/
private function connect()
{
\DB::$host = $this->host;
\DB::$port = $this->port;
\DB::$encoding = $this->encoding;
\DB::$dbName = $this->dbName;
\DB::$user = $this->user;
\DB::$password = $this->password;
}
示例7: getCredemtialsFromConfig
private function getCredemtialsFromConfig()
{
if (is_file(self::$configPath)) {
$configs = parse_ini_file(self::$configPath);
self::$host = $configs['hostname'];
self::$password = $configs['password'];
self::$user = $configs['username'];
}
}
示例8: isAdmin
public function isAdmin()
{
\DB::$user = 'euro2016';
\DB::$password = 'hllau860509';
\DB::$dbName = 'Euro2016';
$row = \DB::queryFirstRow("select * from userroles where userid = %i;", Auth::user()->id);
if (\DB::count() > 0) {
return true;
} else {
return false;
}
}
示例9: getDBConfig
/**
* Grab database values from config file
*/
public function getDBConfig()
{
$this->config = $this->getConfig();
$this->db_host = $this->config['database']['host'];
$this->db_user = $this->config['database']['user'];
$this->db_passwd = $this->config['database']['password'];
$this->db_name = $this->config['database']['dbname'];
$this->db_table = $this->config['database']['table'];
DB::$host = $this->db_host;
DB::$dbName = $this->db_name;
DB::$password = $this->db_passwd;
DB::$user = $this->db_user;
}
示例10: teampass_connect
function teampass_connect()
{
global $server, $user, $pass, $database, $pre, $link;
require_once "../includes/settings.php";
require_once '../includes/libraries/Database/Meekrodb/db.class.php';
DB::$host = $server;
DB::$user = $user;
DB::$password = $pass;
DB::$dbName = $database;
DB::$port = $port;
DB::$error_handler = 'db_error_handler';
$link = mysqli_connect($server, $user, $pass, $database, $port);
}
示例11: updateSettings
function updateSettings($setting, $val, $type = '')
{
global $server, $user, $pass, $database, $pre, $port, $encoding;
if (empty($type)) {
$type = 'admin';
}
require_once $_SESSION['settings']['cpassman_dir'] . '/sources/main.functions.php';
require_once $_SESSION['settings']['cpassman_dir'] . '/sources/SplClassLoader.php';
// Connect to database
require_once $_SESSION['settings']['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
DB::$host = $server;
DB::$user = $user;
DB::$password = $pass;
DB::$dbName = $database;
DB::$port = $port;
DB::$encoding = $encoding;
DB::$error_handler = 'db_error_handler';
$link = mysqli_connect($server, $user, $pass, $database, $port);
$link->set_charset($encoding);
// Check if setting is already in DB. If NO then insert, if YES then update.
$data = DB::query("SELECT * FROM " . prefix_table("misc") . "\n WHERE type = %s AND intitule = %s", $type, $setting);
$counter = DB::count();
if ($counter == 0) {
DB::insert(prefix_table("misc"), array('valeur' => $val, 'type' => $type, 'intitule' => $setting));
// in case of stats enabled, add the actual time
if ($setting == 'send_stats') {
DB::insert(prefix_table("misc"), array('valeur' => time(), 'type' => $type, 'intitule' => $setting . '_time'));
}
} else {
DB::update(prefix_table("misc"), array('valeur' => $val), "type = %s AND intitule = %s", $type, $setting);
// in case of stats enabled, update the actual time
if ($setting == 'send_stats') {
// Check if previous time exists, if not them insert this value in DB
$data_time = DB::query("SELECT * FROM " . prefix_table("misc") . "\n WHERE type = %s AND intitule = %s", $type, $setting . '_time');
$counter = DB::count();
if ($counter == 0) {
DB::insert(prefix_table("misc"), array('valeur' => 0, 'type' => $type, 'intitule' => $setting . '_time'));
} else {
DB::update(prefix_table("misc"), array('valeur' => 0), "type = %s AND intitule = %s", $type, $setting);
}
}
}
$_SESSION['settings'][$setting] = $val;
}
示例12: checkUser
function checkUser($userId, $userKey, $pageVisited)
{
global $pagesRights;
if (empty($userId) || empty($pageVisited) || empty($userKey)) {
return false;
}
if (!is_array($pageVisited)) {
$pageVisited = array($pageVisited);
}
include $_SESSION['settings']['cpassman_dir'] . '/includes/settings.php';
require_once $_SESSION['settings']['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
require_once $_SESSION['settings']['cpassman_dir'] . '/sources/SplClassLoader.php';
require_once 'main.functions.php';
// Connect to mysql server
require_once $_SESSION['settings']['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
DB::$host = $server;
DB::$user = $user;
DB::$password = $pass;
DB::$dbName = $database;
DB::$port = $port;
DB::$encoding = $encoding;
DB::$error_handler = 'db_error_handler';
$link = mysqli_connect($server, $user, $pass, $database, $port);
$link->set_charset($encoding);
// load user's data
$data = DB::queryfirstrow("SELECT login, key_tempo, admin, gestionnaire FROM " . prefix_table("users") . " WHERE id = %i", $userId);
// check if user exists and tempo key is coherant
if (empty($data['login']) || empty($data['key_tempo']) || $data['key_tempo'] != $userKey) {
return false;
}
// check if user is allowed to see this page
if (empty($data['admin']) && empty($data['gestionnaire']) && !IsInArray($pageVisited, $pagesRights['user'])) {
return false;
} else {
if (empty($data['admin']) && !empty($data['gestionnaire']) && !IsInArray($pageVisited, $pagesRights['manager'])) {
return false;
} else {
if (!empty($data['admin']) && !IsInArray($pageVisited, $pagesRights['admin'])) {
return false;
}
}
}
return true;
}
示例13: connect
<?php
require_once 'db/db.class.php';
include 'config.php';
DB::$host = $MYSQL_SERVER;
DB::$port = $MYSQL_PORT;
DB::$user = $MYSQL_USER;
DB::$password = $MYSQL_PASSWORD;
DB::$dbName = $MYSQL_DATABASE;
DB::$encoding = 'utf8_general_ci';
function connect()
{
global $MYSQL_SERVER, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DATABASE;
$link = mysqli_connect($MYSQL_SERVER, $MYSQL_USER, $MYSQL_PASSWORD);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysqli_set_charset($link, 'UTF-8');
if (!mysqli_select_db($link, $MYSQL_DATABASE)) {
echo 'Could not select database';
exit;
}
return $link;
}
示例14: array
<?php
//Including stuff we need
require_once 'meekrodb.2.3.class.php';
require_once 'functions.php';
//Your database information
DB::$user = '';
DB::$password = '';
DB::$dbName = '';
//Enter a unique string for your token
$uniquetoken = 'examplestring123123complex';
//Your phone number info
$numbers = array('+32 466 90 02 78' => array('countrycode' => 'BE', 'source' => 'Plivo'), '+46 76 692 00 61' => array('countrycode' => 'SE', 'source' => 'Plivo'));
示例15: teampassStats
/**
* send statistics about your usage of cPassMan.
* This helps the creator to evaluate the usage you have of the tool.
*/
function teampassStats()
{
global $server, $user, $pass, $database, $pre, $port, $encoding;
require_once $_SESSION['settings']['cpassman_dir'] . '/includes/settings.php';
require_once $_SESSION['settings']['cpassman_dir'] . '/sources/SplClassLoader.php';
// connect to the server
require_once $_SESSION['settings']['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
DB::$host = $server;
DB::$user = $user;
DB::$password = $pass;
DB::$dbName = $database;
DB::$port = $port;
DB::$encoding = $encoding;
DB::$error_handler = 'db_error_handler';
$link = mysqli_connect($server, $user, $pass, $database, $port);
$link->set_charset($encoding);
// Prepare stats to be sent
// Count no FOLDERS
DB::query("SELECT * FROM " . prefix_table("nested_tree") . "");
$dataFolders = DB::count();
// Count no USERS
$dataUsers = DB::query("SELECT * FROM " . $pre . "users");
$dataUsers = DB::count();
// Count no ITEMS
$dataItems = DB::query("SELECT * FROM " . $pre . "items");
$dataItems = DB::count();
// Get info about installation
$dataSystem = array();
$rows = DB::query("SELECT valeur,intitule FROM " . $pre . "misc\n WHERE type = %s\n AND intitule = %ls", 'admin', array('enable_pf_feature', 'log_connections', 'cpassman_version'));
foreach ($rows as $record) {
if ($record['intitule'] == 'enable_pf_feature') {
$dataSystem['enable_pf_feature'] = $record['valeur'];
} elseif ($record['intitule'] == 'cpassman_version') {
$dataSystem['cpassman_version'] = $record['valeur'];
} elseif ($record['intitule'] == 'log_connections') {
$dataSystem['log_connections'] = $record['valeur'];
}
}
// Get the actual stats.
$statsToSend = array('uid' => md5(SALT), 'time_added' => time(), 'users' => $dataUsers[0], 'folders' => $dataFolders[0], 'items' => $dataItems[0], 'cpm_version' => $dataSystem['cpassman_version'], 'enable_pf_feature' => $dataSystem['enable_pf_feature'], 'log_connections' => $dataSystem['log_connections']);
// Encode all the data, for security.
foreach ($statsToSend as $k => $v) {
$statsToSend[$k] = urlencode($k) . '=' . urlencode($v);
}
// Turn this into the query string!
$statsToSend = implode('&', $statsToSend);
fopen("http://www.teampass.net/files/cpm_stats/collect_stats.php?" . $statsToSend, 'r');
// update the actual time
DB::update($pre . "misc", array('valeur' => time()), "type = %s AND intitule = %s", 'admin', 'send_stats_time');
}