将PDO的引用改为大写
This commit is contained in:
parent
270f89754f
commit
0d9a684e61
|
@ -92,7 +92,13 @@ class UsersController extends AbstractActionController
|
|||
|
||||
if($ac == "reset")
|
||||
{
|
||||
|
||||
$users = new \Westdc\Member\Member;
|
||||
if($users->resetPassword($id))
|
||||
{
|
||||
return view::Post($this,"该用户的密码重置成功!",-1);
|
||||
}else{
|
||||
return view::Post($this,"用户密码重置失败!",-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace Sookon\Article;
|
|||
|
||||
use Sookon\Helpers\View as view;
|
||||
use Sookon\Helpers\Dbh as dbh;
|
||||
use Sookon\Helpers\Pdo;
|
||||
use Sookon\Helpers\PDO;
|
||||
use Sookon\Helpers\Config;
|
||||
use Sookon\Helpers\Table;
|
||||
use Zend\Http\PhpEnvironment\Request;
|
||||
|
@ -24,7 +24,7 @@ class Article
|
|||
|
||||
function __construct()
|
||||
{
|
||||
$this->db = new Pdo;
|
||||
$this->db = new PDO;
|
||||
$this->config = Config::get();
|
||||
$this->table = new Table;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace Sookon\Article;
|
|||
|
||||
use Sookon\Helpers\View as view;
|
||||
use Sookon\Helpers\Dbh as dbh;
|
||||
use Sookon\Helpers\Pdo;
|
||||
use Sookon\Helpers\PDO;
|
||||
use Sookon\Helpers\Config;
|
||||
use Sookon\Helpers\Table;
|
||||
use Zend\Http\PhpEnvironment\Request;
|
||||
|
@ -24,7 +24,7 @@ class Category
|
|||
|
||||
function __construct()
|
||||
{
|
||||
$this->db = new Pdo;
|
||||
$this->db = new PDO;
|
||||
$this->config = Config::get();
|
||||
$this->table = new Table;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace Sookon\Article;
|
|||
|
||||
use Sookon\Helpers\View as view;
|
||||
use Sookon\Helpers\Dbh as dbh;
|
||||
use Sookon\Helpers\Pdo;
|
||||
use Sookon\Helpers\PDO;
|
||||
use Sookon\Helpers\Table;
|
||||
|
||||
class Catelog
|
||||
|
@ -18,7 +18,7 @@ class Catelog
|
|||
|
||||
function __construct()
|
||||
{
|
||||
$this->db = new Pdo;
|
||||
$this->db = new PDO;
|
||||
$this->table = new Table;
|
||||
|
||||
$this->opt = new \stdClass();
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace Sookon\Article;
|
|||
|
||||
use Sookon\Helpers\View as view;
|
||||
use Sookon\Helpers\Dbh as dbh;
|
||||
use Sookon\Helpers\Pdo;
|
||||
use Sookon\Helpers\PDO;
|
||||
use Sookon\Helpers\Config;
|
||||
use Sookon\Helpers\Table;
|
||||
use Zend\Http\PhpEnvironment\Request;
|
||||
|
@ -23,7 +23,7 @@ class Lists
|
|||
|
||||
function __construct()
|
||||
{
|
||||
$this->db = new Pdo;
|
||||
$this->db = new PDO;
|
||||
$this->config = Config::get();
|
||||
$this->table = new Table;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace Sookon\Article;
|
|||
|
||||
use Sookon\Helpers\View as view;
|
||||
use Sookon\Helpers\Dbh as dbh;
|
||||
use Sookon\Helpers\Pdo;
|
||||
use Sookon\Helpers\PDO;
|
||||
use Sookon\Helpers\Config;
|
||||
use Sookon\Helpers\Table;
|
||||
use Zend\Http\PhpEnvironment\Request;
|
||||
|
@ -23,7 +23,7 @@ class Tags
|
|||
|
||||
function __construct()
|
||||
{
|
||||
$this->db = new Pdo;
|
||||
$this->db = new PDO;
|
||||
$this->config = Config::get();
|
||||
$this->table = new Table;
|
||||
|
||||
|
|
|
@ -99,14 +99,23 @@ class Member
|
|||
$sql = "UPDATE {$this->table->member} SET activation='$activetion' WHERE id=$id";
|
||||
$state = $this->db->exec($sql);
|
||||
|
||||
$name = empty($user['realname']) ? $user['username'] : $user['realname'];
|
||||
|
||||
if($state)
|
||||
{
|
||||
$data = array(
|
||||
'user' => empty($user['realname']) ? $user['username'] : $user['realname'],
|
||||
'user' => $name,
|
||||
'username' => $user['username'],
|
||||
'url' => view::getHostLink()."/account/fetchpwd/".$username."/".$activetion
|
||||
'url' => view::getHostLink()."/account/fetchpwd/".$user['username']."/".$activetion
|
||||
);
|
||||
|
||||
$mail = new Mail();
|
||||
|
||||
$mail->loadTemplate("user-password-reset-by-admin",$data);
|
||||
$mail->addTo($user['email'],$name);
|
||||
$mail->send();
|
||||
|
||||
return true;
|
||||
|
||||
}else{
|
||||
return false;
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace Westdc\Metadata;
|
|||
|
||||
use Sookon\Helpers\View as view;
|
||||
use Sookon\Helpers\Dbh as dbh;
|
||||
use Sookon\Helpers\Pdo;
|
||||
use Sookon\Helpers\PDO;
|
||||
use Sookon\Helpers\Config;
|
||||
use Sookon\Helpers\Table;
|
||||
use Zend\Http\PhpEnvironment\Request;
|
||||
|
@ -20,7 +20,7 @@ class Metadata
|
|||
|
||||
function __construct()
|
||||
{
|
||||
$this->db = new Pdo;
|
||||
$this->db = new PDO;
|
||||
$this->config = Config::get();
|
||||
$this->table = new Table;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace Westdc\Metadata;
|
|||
|
||||
use Sookon\Helpers\View as view;
|
||||
use Sookon\Helpers\Dbh as dbh;
|
||||
use Sookon\Helpers\Pdo;
|
||||
use Sookon\Helpers\PDO;
|
||||
use Sookon\Helpers\Config;
|
||||
use Sookon\Helpers\Table;
|
||||
use Zend\Http\PhpEnvironment\Request;
|
||||
|
@ -24,7 +24,7 @@ class Outlink
|
|||
|
||||
function __construct()
|
||||
{
|
||||
$this->db = new Pdo;
|
||||
$this->db = new PDO;
|
||||
$this->config = Config::get();
|
||||
$this->table = new Table;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace Westdc\Metadata;
|
|||
|
||||
use Sookon\Helpers\View as view;
|
||||
use Sookon\Helpers\Dbh as dbh;
|
||||
use Sookon\Helpers\Pdo;
|
||||
use Sookon\Helpers\PDO;
|
||||
use Sookon\Helpers\Config;
|
||||
use Sookon\Helpers\Table;
|
||||
use Zend\Http\PhpEnvironment\Request;
|
||||
|
@ -20,7 +20,7 @@ class Tags
|
|||
|
||||
function __construct()
|
||||
{
|
||||
$this->db = new Pdo;
|
||||
$this->db = new PDO;
|
||||
$this->config = Config::get();
|
||||
$this->table = new Table;
|
||||
|
||||
|
|
|
@ -1,57 +1,57 @@
|
|||
<?php
|
||||
namespace Westdc\Metadata;
|
||||
|
||||
use Sookon\Helpers\View as view;
|
||||
use Sookon\Helpers\Dbh as dbh;
|
||||
use Sookon\Helpers\Pdo;
|
||||
use Sookon\Helpers\Config;
|
||||
use Sookon\Helpers\Table;
|
||||
use Zend\Http\PhpEnvironment\Request;
|
||||
|
||||
class Thumb
|
||||
{
|
||||
private $db; //传入PDO对象
|
||||
private $config; //站点设置
|
||||
private $table;
|
||||
|
||||
public $opt;
|
||||
|
||||
protected $events = NULL;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->db = new Pdo;
|
||||
$this->config = Config::get();
|
||||
$this->table = new Table;
|
||||
|
||||
$this->opt = new \stdClass();
|
||||
|
||||
$this->opt->sort = "DESC";
|
||||
$this->opt->logic = "AND";
|
||||
}
|
||||
|
||||
public function getMetadataThumbById($id)
|
||||
{
|
||||
if (!\Sookon\Helpers\Uuid::test($id)) {
|
||||
$where = " m.id=$id ";
|
||||
} else {
|
||||
$where = " m.uuid='$id' ";
|
||||
}
|
||||
|
||||
$sql = "select t.* from thumbnail t left join metadata m on t.id=m.id where ".$where;
|
||||
$thumb = $this->db->query($sql);
|
||||
|
||||
return $thumb->fetch();
|
||||
|
||||
if (empty($thumb['data'])) {
|
||||
header("Content-Type:image/png");
|
||||
header("Content-Length: " . filesize("images/nothumb.png"));
|
||||
$file=fopen("images/nothumb.png",'r');
|
||||
fpassthru($file);
|
||||
exit;
|
||||
} else {
|
||||
header("Content-Type:image/".$thumb['filetype']);
|
||||
print base64_decode($thumb['data']);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
namespace Westdc\Metadata;
|
||||
|
||||
use Sookon\Helpers\View as view;
|
||||
use Sookon\Helpers\Dbh as dbh;
|
||||
use Sookon\Helpers\PDO;
|
||||
use Sookon\Helpers\Config;
|
||||
use Sookon\Helpers\Table;
|
||||
use Zend\Http\PhpEnvironment\Request;
|
||||
|
||||
class Thumb
|
||||
{
|
||||
private $db; //传入PDO对象
|
||||
private $config; //站点设置
|
||||
private $table;
|
||||
|
||||
public $opt;
|
||||
|
||||
protected $events = NULL;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->db = new PDO;
|
||||
$this->config = Config::get();
|
||||
$this->table = new Table;
|
||||
|
||||
$this->opt = new \stdClass();
|
||||
|
||||
$this->opt->sort = "DESC";
|
||||
$this->opt->logic = "AND";
|
||||
}
|
||||
|
||||
public function getMetadataThumbById($id)
|
||||
{
|
||||
if (!\Sookon\Helpers\Uuid::test($id)) {
|
||||
$where = " m.id=$id ";
|
||||
} else {
|
||||
$where = " m.uuid='$id' ";
|
||||
}
|
||||
|
||||
$sql = "select t.* from thumbnail t left join metadata m on t.id=m.id where ".$where;
|
||||
$thumb = $this->db->query($sql);
|
||||
|
||||
return $thumb->fetch();
|
||||
|
||||
if (empty($thumb['data'])) {
|
||||
header("Content-Type:image/png");
|
||||
header("Content-Length: " . filesize("images/nothumb.png"));
|
||||
$file=fopen("images/nothumb.png",'r');
|
||||
fpassthru($file);
|
||||
exit;
|
||||
} else {
|
||||
header("Content-Type:image/".$thumb['filetype']);
|
||||
print base64_decode($thumb['data']);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue