finally removed super-old syscp-update-procedures, we now require the last available syscp for upgrading; migrate some functions to PDO database class, refs #1287

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-11-03 10:54:43 +01:00
parent c9d91d178b
commit e549ab2cbb
21 changed files with 223 additions and 3049 deletions

View File

@@ -15,25 +15,27 @@
*
*/
/*
/**
* Function customerHasPerlEnabled
*
* returns true or false whether perl is
* enabled for the given customer
*
* @param int customer-id
* @param int customer-id
*
* @return boolean
* @return boolean
*/
function customerHasPerlEnabled($cid = 0)
{
global $db, $theme;
function customerHasPerlEnabled($cid = 0) {
if($cid > 0)
{
$result = $db->query_first("SELECT `perlenabled` FROM `".TABLE_PANEL_CUSTOMERS."` WHERE `customerid` = '".(int)$cid."'");
if(is_array($result)
&& isset($result['perlenabled'])
if ($cid > 0) {
$result_stmt = Database::prepare("
SELECT `perlenabled` FROM `".TABLE_PANEL_CUSTOMERS."` WHERE `customerid` = :cid"
);
Database::pexecute($result_stmt, array('cid' => $cid));
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
if (is_array($result)
&& isset($result['perlenabled'])
) {
return ($result['perlenabled'] == '1') ? true : false;
}