[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] api/accounts/class.accounts_sql.php, 1.1.1.1.2.15
From: |
nomail |
Subject: |
[Phpgroupware-cvs] api/accounts/class.accounts_sql.php, 1.1.1.1.2.15 |
Date: |
Thu, 20 May 2004 18:57:33 -0000 |
Update of /api/accounts
Modified Files:
Branch: proposal-branch
class.accounts_sql.php
date: 2004/04/21 06:34:21; author: jengo; state: Exp; lines: +41 -21
Log Message:
Just some mild reformating
=====================================================================
No syntax errors detected in -
=====================================================================
Index: api/accounts/class.accounts_sql.php
diff -u api/accounts/class.accounts_sql.php:1.1.1.1.2.14
api/accounts/class.accounts_sql.php:1.1.1.1.2.15
--- api/accounts/class.accounts_sql.php:1.1.1.1.2.14 Fri Apr 16 20:59:49 2004
+++ api/accounts/class.accounts_sql.php Wed Apr 21 06:34:21 2004
@@ -29,9 +29,9 @@
class api_accounts
{
- var $account_type_cache;
- var $account_id;
- var $data;
+ var $account_type_cache;
+ var $account_id;
+ var $data;
function api_accounts()
{
@@ -96,13 +96,17 @@
function save_repository()
{
- $dbresult = $GLOBALS['phpgw']->db->Execute("UPDATE
phpgw_accounts SET "
- . "account_firstname='" .
$this->data['firstname'] . "',"
- . "account_lastname='" .
$this->data['lastname'] . "',"
- . "account_status='" . $this->data['status'] .
"',"
- . "account_expires='" .
$this->db->to_timestamp($this->data['expires']) . "' "
- . ($this->data['account_lid']?",
account_lid='".$this->data['account_lid']."'":'')
- . ' WHERE account_id=' . $this->account_id);
+ $dbresult = $GLOBALS['phpgw']->db->Execute("
+ UPDATE
+ phpgw_accounts
+ SET
+ account_firstname='" .
$this->data['firstname'] . "',
+ account_lastname='" .
$this->data['lastname'] . "',
+ account_status='" .
$this->data['status'] . "',
+ account_expires='" .
$this->db->to_timestamp($this->data['expires']) . "'
+ " . ($this->data['account_lid']?",
account_lid='".$this->data['account_lid']."'":'') . "
+ WHERE
+ account_id=" . $this->account_id);
return ($GLOBALS['phpgw']->db->Affected_Rows() ? true :
false);
}
@@ -220,9 +224,10 @@
// Set to an array type, in case there are no results
$accounts = array();
- while (!$dbresult->EOF)
+ while (! $dbresult->EOF)
{
- $accounts[] = array(
+ $accounts[] = array
+ (
'account_id' =>
$dbresult->fields['account_id'],
'account_lid' =>
$dbresult->fields['account_lid'],
'account_type' =>
$dbresult->fields['account_type'],
@@ -364,13 +369,28 @@
$dbresult = $GLOBALS['phpgw']->db->Execute("SELECT
account_id FROM phpgw_accounts WHERE account_lid='" . $args['account_lid']."'");
if($dbresult->EOF)
{
- $sql = 'insert into phpgw_accounts
(account_lid, account_type, account_pwd, '
- . "account_firstname, account_lastname,
account_status, account_expires) values ('"
- . $args['account_lid'] . "','" .
$args['account_type'] . "','"
- . md5($args['account_passwd']) . "','"
. $args['account_firstname']
- . "','" . $args['account_lastname'] .
"','" . $args['account_status']
- . "'," .
$GLOBALS['phpgw']->db->dbtimestamp($args['account_expires']) . ")";
-
+ $sql = "INSERT INTO
+ phpgw_accounts
+ (
+ account_lid,
+ account_type,
+ account_pwd,
+ account_firstname,
+ account_lastname,
+ account_status,
+ account_expires
+ )
+ VALUES
+ ('"
+ . $args['account_lid']
. "',
+ '" .
$args['account_type'] . "','"
+ .
md5($args['account_passwd']) . "',
+ '" .
$args['account_firstname'] . "',
+ '" .
$args['account_lastname'] . "',
+ '" .
$args['account_status'] . "',
+ " .
$GLOBALS['phpgw']->db->dbtimestamp($args['account_expires']) . "
+ )";
+
$GLOBALS['phpgw']->db->Execute($sql);
$dbresult =
$GLOBALS['phpgw']->db->Execute("SELECT account_id FROM phpgw_accounts WHERE
account_lid='" . $args['account_lid']."'");
return $dbresult->fields['account_id'];
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] api/accounts/class.accounts_sql.php, 1.1.1.1.2.15,
nomail <=