Added file space option, file_space column to phpgw_accounts

This commit is contained in:
zone 2001-07-01 22:30:07 +00:00
parent 8336f15469
commit e6203dda83
5 changed files with 34 additions and 15 deletions

View File

@ -89,6 +89,7 @@
$this->data['lastpasswd_change'] = $this->db->f('account_lastpwd_change');
$this->data['status'] = $this->db->f('account_status');
$this->data['expires'] = -1;
$this->data['file_space'] = $this->db->f('account_file_space');
return $this->data;
}
@ -136,8 +137,8 @@
$this->db->query("update phpgw_accounts set account_firstname='" . $this->data['firstname']
. "', account_lastname='" . $this->data['lastname'] . "', account_status='"
. $this->data['status'] . "' where account_id='" . $this->account_id . "'",__LINE__,__FILE__);
. $this->data['status'] . "', account_file_space='" . $this->data['file_space']
. "' where account_id='" . $this->account_id . "'",__LINE__,__FILE__);
}
function delete($accountid = '')
@ -218,7 +219,8 @@
'account_type' => $this->db->f('account_type'),
'account_firstname' => $allValues[0]['givenname'][0],
'account_lastname' => $allValues[0]['sn'][0],
'account_status' => $this->db->f('account_status')
'account_status' => $this->db->f('account_status'),
'account_file_space' => $this->db->f('account_file_space'),
);
}
else
@ -229,7 +231,8 @@
'account_type' => $this->db->f('account_type'),
'account_firstname' => $this->db->f('account_firstname'),
'account_lastname' => $this->db->f('account_lastname'),
'account_status' => $this->db->f('account_status')
'account_status' => $this->db->f('account_status'),
'account_file_space' => $this->db->f('account_file_space'),
);
}
}
@ -363,9 +366,10 @@
}
$this->db->query("INSERT INTO phpgw_accounts (account_id, account_lid, account_type, account_pwd, "
. "account_firstname, account_lastname, account_status, account_expires) VALUES ('" . $account_id . "','" . $account_info['account_lid']
. "account_firstname, account_lastname, account_status, account_expires, account_file_space) VALUES ('" . $account_id . "','" . $account_info['account_lid']
. "','" . $account_info['account_type'] . "','" . md5($account_info['account_passwd']) . "', '" . $account_info['account_firstname']
. "','" . $account_info['account_lastname'] . "','" . $account_info['account_status'] . "'," . $account_info['account_expires'] . ")",__LINE__,__FILE__);
. "','" . $account_info['account_lastname'] . "','" . $account_info['account_status'] . "'," . $account_info['account_expires'] . ",'" . $account_info['account_file_space'] . "')",__LINE__,__FILE__);
$sri = ldap_search($ds, $phpgw_info['server']['ldap_context'],'uid=' . $account_info['account_lid']);
$allValues = ldap_get_entries($ds, $sri);
@ -480,8 +484,8 @@
// $defaultprefs = 'a:5:{s:6:"common";a:1:{s:0:"";s:2:"en";}s:11:"addressbook";a:1:{s:0:"";s:4:"True";}s:8:"calendar";a:1:{s:0:"";s:13:"workdaystarts";}i:15;a:1:{s:0:"";s:11:"workdayends";}s:6:"Monday";a:1:{s:0:"";s:13:"weekdaystarts";}}';
}
$sql = "insert into phpgw_accounts";
$sql .= "(account_id, account_lid, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status, account_type)";
$sql .= "values (".$accountid.", '".$accountname."', '".md5($passwd)."', '".$accountname."', 'AutoCreated', ".time().", 'A','u')";
$sql .= "(account_id, account_lid, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status, account_type, account_file_space)";
$sql .= "values (".$accountid.", '".$accountname."', '".md5($passwd)."', '".$accountname."', 'AutoCreated', ".time().", 'A','u','" . $phpgw_info['server']['vfs_default_account_size_number'] . "-" . $phpgw_info['server']['vfs_default_account_size_type'] . "')";
$this->db->query($sql);
$this->db->query("insert into phpgw_preferences (preference_owner, preference_value) values ('".$accountid."', '$defaultprefs')");
$this->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights)values('preferences', 'changepassword', ".$accountid.", 'u', 1)",__LINE__,__FILE__);

View File

@ -56,6 +56,7 @@
$this->data['lastpasswd_change'] = $this->db->f('account_lastpwd_change');
$this->data['status'] = $this->db->f('account_status');
$this->data['expires'] = $this->db->f('account_expires');
$this->data['file_space'] = $this->db->f('account_file_space');
return $this->data;
}
@ -63,7 +64,8 @@
{
$this->db->query("UPDATE phpgw_accounts SET account_firstname='" . $this->data['firstname']
. "', account_lastname='" . $this->data['lastname'] . "', account_status='"
. $this->data['status'] . "', account_expires='" . $this->data['expires'] . "' WHERE account_id='"
. $this->data['status'] . "', account_expires='" . $this->data['expires']
. "', account_file_space='" . $this->data['file_space'] . "' WHERE account_id='"
. $this->account_id . "'",__LINE__,__FILE__);
}
@ -148,7 +150,8 @@
'account_firstname' => $this->db->f('account_firstname'),
'account_lastname' => $this->db->f('account_lastname'),
'account_status' => $this->db->f('account_status'),
'account_expires' => $this->db->f('account_expires')
'account_expires' => $this->db->f('account_expires'),
'account_file_space' => $this->db->f('account_file_space'),
);
}
return $accounts;
@ -220,9 +223,9 @@
function create($account_info)
{
$this->db->query("insert into phpgw_accounts (account_lid, account_type, account_pwd, "
. "account_firstname, account_lastname, account_status, account_expires) values ('" . $account_info['account_lid']
. "account_firstname, account_lastname, account_status, account_expires, account_file_space) values ('" . $account_info['account_lid']
. "','" . $account_info['account_type'] . "','" . md5($account_info['account_passwd']) . "', '" . $account_info['account_firstname']
. "','" . $account_info['account_lastname'] . "','" . $account_info['account_status'] . "','" . $account_info['account_expires']
. "','" . $account_info['account_lastname'] . "','" . $account_info['account_status'] . "','" . $account_info['account_expires'] . "','" . $account_info['account_file_space']
. "')",__LINE__,__FILE__);
}
@ -243,7 +246,8 @@
'account_firstname' => '',
'account_lastname' => '',
'account_status' => $account_status,
'account_expires' => mktime(2,0,0,date('n',$expiredate), intval(date('d',$expiredate)), date('Y',$expiredate))
'account_expires' => mktime(2,0,0,date('n',$expiredate), intval(date('d',$expiredate)), date('Y',$expiredate)),
'account_file_space' => $phpgw_info['server']['vfs_default_account_size_number'] . "-" . $phpgw_info['server']['vfs_default_account_size_type'],
);
$this->create($acct_info);
$accountid = $this->name2id($accountname);

View File

@ -14,7 +14,7 @@
/* Basic information about this app */
$setup_info['phpgwapi']['name'] = 'phpgwapi';
$setup_info['phpgwapi']['title'] = 'phpgwapi';
$setup_info['phpgwapi']['version'] = '0.9.13.002';
$setup_info['phpgwapi']['version'] = '0.9.13.003';
$setup_info['phpgwapi']['versions']['current_header'] = '1.16';
$setup_info['phpgwapi']['enable'] = 3;
$setup_info['phpgwapi']['app_order'] = 1;

View File

@ -63,7 +63,8 @@
'account_lastpwd_change' => array('type' => 'int', 'precision' => 4),
'account_status' => array('type' => 'char', 'precision' => 1, 'nullable' => false, 'default' => 'A'),
'account_expires' => array('type' => 'int', 'precision' => 4),
'account_type' => array('type' => 'char', 'precision' => 1, 'nullable' => true)
'account_type' => array('type' => 'char', 'precision' => 1, 'nullable' => true),
'account_file_space' => array('type' => 'varchar', 'precision' => 25),
),
'pk' => array('account_id'),
'fk' => array(),

View File

@ -1489,4 +1489,14 @@
return $setup_info['phpgwapi']['currentver'];
//return True;
}
$test[] = '0.9.13.002';
function phpgwapi_upgrade0_9_13_002()
{
global $setup_info,$phpgw_setup;
$phpgw_setup->oProc->AddColumn('phpgw_accounts','account_file_space', array ('type' => 'varchar', 'precision' => 25));
return $setup_info['phpgwapi']['currentver'];
//return True;
}
?>