lambda-cvs Mailing List for Lambda
Status: Pre-Alpha
Brought to you by:
ariejan
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
(38) |
Aug
(5) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(11) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ariejan de V. <ar...@us...> - 2005-07-26 14:36:05
|
Update of /cvsroot/lambda/lambda/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9918/include Modified Files: mysql.php Log Message: Added db_update Index: mysql.php =================================================================== RCS file: /cvsroot/lambda/lambda/include/mysql.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mysql.php 26 Jul 2005 14:22:39 -0000 1.3 --- mysql.php 26 Jul 2005 14:35:25 -0000 1.4 *************** *** 173,176 **** --- 173,178 ---- if(is_array($conditions)) { + $sql .= " WHERE"; + foreach($conditions as $condition) { *************** *** 226,228 **** --- 228,277 ---- return db_query($sql); } + + /** + * db_update + * + * Easy UPDATE function + * + * table: string *Required* + * data: array with new data to be updated ('field' => 'value') *Required* + * conditions: array with conditions. Null will update ALL ROWS!! *Recommended* + * + * Returns true on succes, otherwise false + **/ + function db_update($table, $data, $conditions) + { + $sql = "UPDATE `".$table."` SET"; + + if(is_array($data)) + { + while(list($key, $val) = each($data)) + { + $sql .= " `".$key."`='".$val."',"; + } + // Remove trailing comma + $sql = substr($sql, 0, -1); + + if(is_array($conditions)) + { + $sql .= " WHERE"; + + foreach($conditions as $condition) + { + $sql .= " ". $condition ." AND"; + } + + // Remove trailing AND + $sql = substr($sql, 0, -4); + } + + // Perform query + return db_query($sql); + } + else + { + // No data + return false; + } + } ?> \ No newline at end of file |
From: Ariejan de V. <ar...@us...> - 2005-07-26 14:22:48
|
Update of /cvsroot/lambda/lambda/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6278/include Modified Files: mysql.php Log Message: Added db_insert and made some minor fixes to db_select Index: mysql.php =================================================================== RCS file: /cvsroot/lambda/lambda/include/mysql.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mysql.php 26 Jul 2005 14:04:49 -0000 1.2 --- mysql.php 26 Jul 2005 14:22:39 -0000 1.3 *************** *** 154,158 **** foreach($fields as $field) { ! $sql .= " ". $field .","; } --- 154,158 ---- foreach($fields as $field) { ! $sql .= " `". $field ."`,"; } *************** *** 188,190 **** --- 188,228 ---- } + /** + * db_insert + * + * Easy INSERT function + * + * table: string *Required* + * data: array with data to be inserted ('field' => 'value') *Required* + * + * Returns true on succes, otherwise false + **/ + function db_insert($table, $data) + { + $sql = "INSERT INTO `". $table ."` ("; + + while(list($key, $val) = each($data)) + { + $sql .= "`".$key."`, "; + } + + // remove last space and comma + $sql = substr($sql, 0, -2); + + $sql .= ") VALUES ("; + + reset($data); + while(list($key, $val) = each($data)) + { + $sql .= "'".$val."', "; + } + + // remove last space and comma + $sql = substr($sql, 0, -2); + + $sql .= ")"; + + // Perform query + return db_query($sql); + } ?> \ No newline at end of file |
From: Ariejan de V. <ar...@us...> - 2005-07-26 14:05:00
|
Update of /cvsroot/lambda/lambda/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1891/conf Modified Files: config-sample.php Log Message: Added db_select meta function Index: config-sample.php =================================================================== RCS file: /cvsroot/lambda/lambda/conf/config-sample.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** config-sample.php 26 Jul 2005 13:32:52 -0000 1.3 --- config-sample.php 26 Jul 2005 14:04:48 -0000 1.4 *************** *** 25,29 **** $cfg['MysqlHostname'] = 'localhost'; // Hostname of your MySQL Server ! $cfg['MysqlUsername'] = 'username'; // Username for MySQL $cfg['MysqlPassword'] = 'secret'; // Password for above user $cfg['MysqlDatabase'] = 'lambda'; // Name of your Lambda database --- 25,29 ---- $cfg['MysqlHostname'] = 'localhost'; // Hostname of your MySQL Server ! $cfg['MysqlUsername'] = 'lambda'; // Username for MySQL $cfg['MysqlPassword'] = 'secret'; // Password for above user $cfg['MysqlDatabase'] = 'lambda'; // Name of your Lambda database |
From: Ariejan de V. <ar...@us...> - 2005-07-26 14:04:58
|
Update of /cvsroot/lambda/lambda/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1891/include Modified Files: mysql.php Log Message: Added db_select meta function Index: mysql.php =================================================================== RCS file: /cvsroot/lambda/lambda/include/mysql.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mysql.php 26 Jul 2005 13:33:00 -0000 1.1 --- mysql.php 26 Jul 2005 14:04:49 -0000 1.2 *************** *** 100,104 **** function db_res2array($res) { ! // TODO } --- 100,114 ---- function db_res2array($res) { ! // We want the entire resource, so move the interal data pointer ! @mysql_data_seek($res, 0); ! ! $result = array(); ! ! while($row = db_fetch_row($res)) ! { ! $result[] = $row; ! } ! ! return $result; } *************** *** 123,126 **** --- 133,190 ---- } + /** + * db_select + * + * Easy SELECT function + * + * table: string *Required* + * fields: array with fields to select, null will return all fields *Optional* + * conditions: Array with SQL conditions, null for no conditions *Optional* + * + * Returns Assoc Array on succes, otherwise false + **/ + function db_select($table, $fields = null, $conditions = null) + { + // Construct SQL Query + $sql = "SELECT"; + + // Add fields + if(is_array($fields)) + { + foreach($fields as $field) + { + $sql .= " ". $field .","; + } + + // Remove the trailing comma + $sql = substr($sql, 0, -1); + + + } + else + { + $sql .= " *"; + } + + // Add table + $sql .= " FROM `".$table ."`"; + + // Add conditions + if(is_array($conditions)) + { + foreach($conditions as $condition) + { + $sql .= " ". $condition ." AND"; + } + + // Remove trailing AND + $sql = substr($sql, 0, -4); + } + + // Perform query + $sqlresult = db_query($sql); + + return db_res2array($sqlresult); + } ?> \ No newline at end of file |
From: Ariejan de V. <ar...@us...> - 2005-07-26 14:04:57
|
Update of /cvsroot/lambda/lambda In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1891 Modified Files: .cvsignore Log Message: Added db_select meta function Index: .cvsignore =================================================================== RCS file: /cvsroot/lambda/lambda/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 24 Jul 2005 13:35:23 -0000 1.2 --- .cvsignore 26 Jul 2005 14:04:48 -0000 1.3 *************** *** 1 **** --- 1,2 ---- + test.php *~ |
From: Ariejan de V. <ar...@us...> - 2005-07-26 13:33:08
|
Update of /cvsroot/lambda/lambda/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26802/lang Modified Files: english.php Log Message: Added simple MySQL and error handling support. Index: english.php =================================================================== RCS file: /cvsroot/lambda/lambda/lang/english.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** english.php 22 Jul 2005 11:36:16 -0000 1.1.1.1 --- english.php 26 Jul 2005 13:33:00 -0000 1.2 *************** *** 6,13 **** * * Copyright (C) 2005 Ariejan de Vroom ! * Licensed under the General Public License (GPL) * * $Id$ */ ?> \ No newline at end of file --- 6,20 ---- * * Copyright (C) 2005 Ariejan de Vroom ! * Licensed under the General Public License (GPL) * * $Id$ */ + /** + * Error messages + **/ + $error[0] = "Unknown error."; + $error[1001] = "Database connection is not available."; + + ?> \ No newline at end of file |
From: Ariejan de V. <ar...@us...> - 2005-07-26 13:33:08
|
Update of /cvsroot/lambda/lambda/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26802/conf Modified Files: config-sample.php defaults.php Log Message: Added simple MySQL and error handling support. Index: defaults.php =================================================================== RCS file: /cvsroot/lambda/lambda/conf/defaults.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** defaults.php 22 Jul 2005 11:36:16 -0000 1.1.1.1 --- defaults.php 26 Jul 2005 13:32:59 -0000 1.2 *************** *** 33,44 **** * Start the page template output */ ! require_once($config['smarty']['path']); $page = new Smarty(); ! $page->template_dir = $config['smarty']['theme_dir']."/".$config['lambda']['theme']; ! $page->compile_dir = $config['smarty']['compile_dir']; ! $page->assign('site_title', $config['lambda']['sitename']); $page->assign('theme_url', ! $config['lambda']['siteurl']."/".$config['smarty']['theme_dir']."/".$config['lambda']['theme']); ?> \ No newline at end of file --- 33,59 ---- * Start the page template output */ ! require_once($cfg['SmartyPath']); $page = new Smarty(); ! $page->template_dir = $cfg['SmartyThemeDir']."/".$cfg['LambdaDefaultTheme']; ! $page->compile_dir = $cfg['SmartyCompileDir']; ! $page->assign('site_title', $cfg['LambdaSiteName']); $page->assign('theme_url', ! $cfg['LambdaSiteURL']."/".$cfg['SmartyThemeDir']."/".$cfg['LambdaDefaulTheme']); ! ! /** ! * Load language file ! **/ ! require_once("lang/" . $cfg['LambdaDefaultLanguage'] . ".php"); ! ! /** ! * Load General functionality ! **/ ! require_once("include/functions.php"); ! ! /** ! * Load MySQL Database support ! **/ ! require_once("include/mysql.php"); ?> \ No newline at end of file Index: config-sample.php =================================================================== RCS file: /cvsroot/lambda/lambda/conf/config-sample.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** config-sample.php 24 Jul 2005 13:42:37 -0000 1.2 --- config-sample.php 26 Jul 2005 13:32:52 -0000 1.3 *************** *** 18,21 **** --- 18,22 ---- $cfg['LambdaSiteURL'] = 'http://localhost'; // URL for your site $cfg['LambdaDefaultTheme'] = 'lambda'; // Default theme + $cfg['LambdaDefaultLanguage'] = 'english'; // Default language /********** |
From: Ariejan de V. <ar...@us...> - 2005-07-26 13:33:08
|
Update of /cvsroot/lambda/lambda/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26802/include Added Files: functions.php mysql.php Log Message: Added simple MySQL and error handling support. --- NEW FILE: functions.php --- <?php /** * Lambda - Online Bookmark System * http://www.sf.net/projects/lambda * * Copyright (C) 2005 Ariejan de Vroom * Licensed under the General Public License (GPL) * * $Id: functions.php,v 1.1 2005/07/26 13:33:00 ariejan Exp $ */ /** * die_error * * Stop execution with given error ID **/ function die_error($id = 0) { global $error; die("Lambda Error ".$id.": ".$error[$id]); } ?> --- NEW FILE: mysql.php --- <?php /** * Lambda - Online Bookmark System * http://www.sf.net/projects/lambda * * Copyright (C) 2005 Ariejan de Vroom * Licensed under the General Public License (GPL) * * $Id: mysql.php,v 1.1 2005/07/26 13:33:00 ariejan Exp $ */ /** * Global MySQL Link identifier **/ $db_link = null; /** * SQL History **/ $sql_history = array(); /** * db_connect * * Connect to the MySQL database when not yet connected. * Returns true on success, otherwise false **/ function db_connect() { global $cfg, $db_link; if($db_link == null) { if($cfg['MysqlPersistent']) { $db_link = @mysql_pconnect($cfg['MysqlHostname'], $cfg['MysqlUsername'], $cfg['MysqlPassword'], true); } else { $db_link = @mysql_connect($cfg['MysqlHostname'], $cfg['MysqlUsername'], $cfg['MysqlPassword'], true); } if(@mysql_select_db($cfg['MysqlDatabase'], $db_link) == false) { return false; } else { return true; } } else { // Already connected return true; } } /** * db_query * * Query the database * Make a connection when none is available * * $sql contains valid SQL code * * Return the result set or false **/ function db_query($sql) { global $db_link, $sql_history; // Verify connection if(!$db_link && !db_connect()) { die_error(1001); } $result = @mysql_query($sql, $db_link); // Add query to sql_history and return if($result) { $sql_history[] = array('sql'=>$sql, 'success'=>true); return $result; } else { $sql_history[] = array('sql'=>$sql, 'success'=>false); return false; } } /** * db_res2array * * Convert a MySQL Resource to an associative array **/ function db_res2array($res) { // TODO } /** * db_num_rows * * Return the number of rows in the MySQL Result **/ function db_num_rows($res) { return @mysql_num_rows($res); } /** * db_fetch_row * * Return the next row as an assoc array **/ function db_fetch_row($res) { return @mysql_fetch_assoc($res); } ?> |
From: Ariejan de V. <ar...@us...> - 2005-07-24 13:57:15
|
Update of /cvsroot/lambda/lambda/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26520/include Log Message: Directory /cvsroot/lambda/lambda/include added to the repository |
From: Ariejan de V. <ar...@us...> - 2005-07-24 13:42:46
|
Update of /cvsroot/lambda/lambda/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24447/conf Modified Files: config-sample.php Log Message: Updated configfile format for easier usage and readability Index: config-sample.php =================================================================== RCS file: /cvsroot/lambda/lambda/conf/config-sample.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** config-sample.php 22 Jul 2005 11:36:16 -0000 1.1.1.1 --- config-sample.php 24 Jul 2005 13:42:37 -0000 1.2 *************** *** 15,38 **** *********/ ! /** ! * The name of your Lambda site. ! * ! * This title will be displayed throughout your site. ! */ ! $config['lambda']['sitename'] = 'Lambda - Online Bookmark System'; ! ! /** ! * The full URL of your Lambda site ! * ! * This URL will be used to reference your site. ! */ ! $config['lambda']['siteurl'] = 'http://trinity'; ! ! /** ! * The default theme for your Lambda site. ! * ! * This theme will be used by default, but may be overridden by users if other themes are available. ! */ ! $config['lambda']['theme'] = 'lambda'; /********** --- 15,21 ---- *********/ ! $cfg['LambdaSitename'] = 'Lambda - Online Bookmark System'; // Your site name ! $cfg['LambdaSiteURL'] = 'http://localhost'; // URL for your site ! $cfg['LambdaDefaultTheme'] = 'lambda'; // Default theme /********** *************** *** 40,96 **** *********/ ! /** ! * MySQL server host ! * ! * Mostly this will be 'localhost' ! */ ! $config['db']['hostname'] = 'localhost'; ! ! /** ! * MySQL username ! * ! * Connect to MySQL as this user. ! */ ! $config['db']['username'] = 'username'; ! ! /** ! * MySQL password ! * ! * Password for the above user ! */ ! $config['db']['password'] = 'secret'; ! ! /** ! * MySQL database ! * ! * The name of the database containing your Lambda data ! */ ! $config['db']['database'] = 'lambda'; ! /********** ! * Lambda defaults *********/ ! /** ! * Smarty location ! * ! * Location of Smarty.class.php ! */ ! $config['smarty']['path'] = 'smarty/Smarty.class.php'; ! ! /** ! * Smarty template location ! * ! * Location of themes ! */ ! $config['smarty']['theme_dir'] = 'themes'; ! ! /** ! * Smarty compile directory ! * ! * Directory where smarty stores it's compiled templates ! * ! * !!!!! This directory must be writable by the webserver !!!!! ! */ ! $config['smarty']['compile_dir'] = 'smarty/template_c'; ?> \ No newline at end of file --- 23,38 ---- *********/ ! $cfg['MysqlHostname'] = 'localhost'; // Hostname of your MySQL Server ! $cfg['MysqlUsername'] = 'username'; // Username for MySQL ! $cfg['MysqlPassword'] = 'secret'; // Password for above user ! $cfg['MysqlDatabase'] = 'lambda'; // Name of your Lambda database ! $cfg['MysqlPersistent'] = false; // Use persistent connections? ! // Set false when using public hosting /********** ! * Lambda defaults **** YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE! ***** *********/ ! $cfg['SmartyPath'] = 'smarty/Smarty.class.php'; // Path to Smarty.class.php ! $cfg['SmartyThemeDir'] = 'themes'; // Themes directory ! $cfg['SmartyCompileDir'] = 'smarty/template_c'; // Smarty compile directory ?> \ No newline at end of file |
From: Ariejan de V. <ar...@us...> - 2005-07-24 13:35:33
|
Update of /cvsroot/lambda/lambda In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23378 Modified Files: .cvsignore Log Message: Little change to .cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/lambda/lambda/.cvsignore,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** .cvsignore 22 Jul 2005 11:36:16 -0000 1.1.1.1 --- .cvsignore 24 Jul 2005 13:35:23 -0000 1.2 *************** *** 1 **** ! *~ \ No newline at end of file --- 1 ---- ! *~ |
From: Shawn L. <das...@us...> - 2004-08-04 18:21:23
|
Update of /cvsroot/lambda/docs/dia In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11418 Modified Files: add_email_alias_swimline.dia add_email_swimline.dia Log Message: Added check for duplicates Index: add_email_alias_swimline.dia =================================================================== RCS file: /cvsroot/lambda/docs/dia/add_email_alias_swimline.dia,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsep0ifK and /tmp/cvsYcxTpQ differ Index: add_email_swimline.dia =================================================================== RCS file: /cvsroot/lambda/docs/dia/add_email_swimline.dia,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsF4KowP and /tmp/cvsfd49JV differ |
From: Shawn L. <das...@us...> - 2004-08-04 17:43:50
|
Update of /cvsroot/lambda/docs/dia In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4816 Modified Files: add_email_swimline.dia Log Message: Added the check for duplicates procedure Index: add_email_swimline.dia =================================================================== RCS file: /cvsroot/lambda/docs/dia/add_email_swimline.dia,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsweE4yI and /tmp/cvsn4sF4b differ |
Update of /cvsroot/lambda/docs/dia In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26780 Added Files: add_db_swimline.dia add_domain_entry_swimline.dia add_domain_swimline.dia add_domain_template_swimline.dia add_email_alias_swimline.dia add_email_swimline.dia add_ftp_swimline.dia add_site_swimline.dia api.dia change_limits_email_swimline.dia change_password_email_swimline.dia delete_db_swimline.dia delete_domain_entry_swimline.dia delete_domain_swimline.dia delete_domain_template_swimline.dia delete_email_alias_swimline.dia delete_email_swimline.dia delete_ftp_swimline.dia delete_site_swimline.dia disable_site_swimline.dia email_class.dia enable_site_swimline.dia filesystem.dia interface_layers.dia use_case.dia Log Message: Initial swimlane diagram for the API. Initial Use Case diagram Initial API diagram --- NEW FILE: delete_db_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: delete_domain_entry_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: filesystem.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: add_email_alias_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: add_domain_entry_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: add_db_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: use_case.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: disable_site_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: add_ftp_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: interface_layers.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: change_limits_email_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: delete_ftp_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: api.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: add_domain_template_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: change_password_email_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: email_class.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: delete_site_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: enable_site_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: delete_domain_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: delete_email_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: delete_domain_template_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: add_domain_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: add_site_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: delete_email_alias_swimline.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: add_email_swimline.dia --- (This appears to be a binary file; contents omitted.) |
From: Shawn L. <das...@us...> - 2004-08-04 16:46:02
|
Update of /cvsroot/lambda/docs/dia In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26443/docs/dia Log Message: Directory /cvsroot/lambda/docs/dia added to the repository |
From: Shawn L. <das...@us...> - 2004-08-04 16:45:51
|
Update of /cvsroot/lambda/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26429/docs Log Message: Directory /cvsroot/lambda/docs added to the repository |
From: Shawn L. <das...@us...> - 2004-07-22 02:23:28
|
Update of /cvsroot/lambda/devdoc/flow_charts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19572 Added Files: use_case.dia Log Message: Added new use case showing the 4 users of the system --- NEW FILE: use_case.dia --- (This appears to be a binary file; contents omitted.) |
From: Shawn L. <das...@us...> - 2004-07-21 23:14:31
|
Update of /cvsroot/lambda/devdoc/flow_charts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22662 Added Files: api.dia filesystem.dia interface_layers.dia Log Message: New Flow Charts about the different components of lambda. --- NEW FILE: interface_layers.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: filesystem.dia --- (This appears to be a binary file; contents omitted.) --- NEW FILE: api.dia --- (This appears to be a binary file; contents omitted.) |
From: Shawn L. <das...@us...> - 2004-07-21 23:12:44
|
Update of /cvsroot/lambda/devdoc/flow_charts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22319/flow_charts Log Message: Directory /cvsroot/lambda/devdoc/flow_charts added to the repository |
From: Ariejan de V. <ar...@us...> - 2004-07-08 09:57:49
|
Update of /cvsroot/lambda/lambda/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15617/database Added Files: README lambda-20040708.sql Log Message: Added mysql dump for client table --- NEW FILE: README --- These SQL dumps are made with mysqldump. You can import them manually or by using PHPMyAdmin. If you create a new dump, please suffix is with the current date. In case you receive errors during development, make sure you have the latest SQL snapshot loaded! --- NEW FILE: lambda-20040708.sql --- -- MySQL dump 9.10 -- -- Host: localhost Database: lambda -- ------------------------------------------------------ -- Server version 4.0.18 -- -- Table structure for table `client` -- CREATE TABLE client ( id bigint(20) unsigned NOT NULL auto_increment, login varchar(20) NOT NULL default '', password varchar(32) NOT NULL default '', name varchar(200) NOT NULL default '', address varchar(200) default NULL, zipcode varchar(20) default NULL, city varchar(200) default NULL, state char(2) default NULL, country char(2) default NULL, phone varchar(20) default NULL, fax varchar(20) default NULL, email varchar(200) default NULL, companyname varchar(200) default NULL, adminflag char(1) NOT NULL default 'C', PRIMARY KEY (id), UNIQUE KEY login (login) ) TYPE=MyISAM COMMENT='Client data'; -- -- Dumping data for table `client` -- INSERT INTO client VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3','Lambda Administrator','Sondervick 35A','5505NB','Veldhoven',NULL,'NL','+31 611 316064',NULL,'web...@la...','Project Lambda','A'); |
From: Ariejan de V. <ar...@us...> - 2004-07-08 09:56:39
|
Update of /cvsroot/lambda/lambda/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15449/database Log Message: Directory /cvsroot/lambda/lambda/database added to the repository |
From: Ariejan de V. <ar...@us...> - 2004-07-08 09:52:19
|
Update of /cvsroot/lambda/lambda/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14548/classes Modified Files: lambdaClient.class.php lambdaMySQLi.class.php lambdaSession.class.php Log Message: * Added *very* basic GUI * Added client/admin login and logout functionality * Updated stylesheet Index: lambdaSession.class.php =================================================================== RCS file: /cvsroot/lambda/lambda/classes/lambdaSession.class.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lambdaSession.class.php 7 Jul 2004 14:46:14 -0000 1.2 --- lambdaSession.class.php 8 Jul 2004 09:52:04 -0000 1.3 *************** *** 34,37 **** --- 34,39 ---- **/ function start() { + global $client; + // Start the session if it is not yet active if(!session_id()) { *************** *** 39,42 **** --- 41,49 ---- } $this->handler->debug("Session started", 2); + + /* Load any logged in client data */ + if(isset($_SESSION['client_id'])) { + $client = new lambdaClient($_SESSION['client_id']); + } } *************** *** 68,72 **** **/ function login() { ! if(isset($_SESSION['client_id']) || isset($_SESSION['admin_id'])) { return true; } else { --- 75,79 ---- **/ function login() { ! if(isset($_SESSION['client_id'])) { return true; } else { *************** *** 76,84 **** /** * Destroy the current session **/ ! function destory() { session_destroy(); $this->handler->debug("Session destroyed", 2); } } --- 83,108 ---- /** + * Register a client as logged in + * + * @param object Client object + **/ + function register_client($client) { + $_SESSION['client_id'] = $client->client_id; + } + + /** * Destroy the current session **/ ! function destroy() { session_destroy(); $this->handler->debug("Session destroyed", 2); } + + /** + * Logout a logged in client + **/ + function logout() { + $this->unregister('client_id'); + $this->destroy(); + } } Index: lambdaMySQLi.class.php =================================================================== RCS file: /cvsroot/lambda/lambda/classes/lambdaMySQLi.class.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** lambdaMySQLi.class.php 7 Jul 2004 13:10:39 -0000 1.7 --- lambdaMySQLi.class.php 8 Jul 2004 09:52:04 -0000 1.8 *************** *** 52,56 **** // Set default zero-values ! $this->link = null; $this->query_count = 0; $this->query_history = array(); --- 52,56 ---- // Set default zero-values ! $this->link = false; $this->query_count = 0; $this->query_history = array(); *************** *** 77,81 **** $mylink = @mysql_connect($host, $this->config['username'], $this->config['password'], true); ! // Select the proper database and check for errors if(!@mysql_select_db($this->config['dbname'], $mylink)) { --- 77,81 ---- $mylink = @mysql_connect($host, $this->config['username'], $this->config['password'], true); ! // Select the proper database and check for errors if(!@mysql_select_db($this->config['dbname'], $mylink)) { *************** *** 87,91 **** } } ! /** * Perform a query --- 87,91 ---- } } ! /** * Perform a query *************** *** 98,102 **** function query($sql) { // Make sure we have a valid connection ! if(!$this->link || !@$this->connect()) { return false; } --- 98,102 ---- function query($sql) { // Make sure we have a valid connection ! if(!$this->link && !$this->connect()) { return false; } *************** *** 128,130 **** --- 128,140 ---- return @mysql_num_rows($res); } + + /** + * Fetch the next result row as an associative array + * + * @param object Valid MySQL result resource + * @return array The next result row as an associative array + **/ + function fetch_array($res) { + return @mysql_fetch_assoc($res); + } } \ No newline at end of file Index: lambdaClient.class.php =================================================================== RCS file: /cvsroot/lambda/lambda/classes/lambdaClient.class.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** lambdaClient.class.php 7 Jul 2004 13:10:39 -0000 1.6 --- lambdaClient.class.php 8 Jul 2004 09:52:04 -0000 1.7 *************** *** 48,52 **** * in $data. * ! * @param int Client ID or 0 for new client **/ function lambdaClient($client_id = 0) { --- 48,52 ---- * in $data. * ! * @param int Client ID or 0 for new client or login client **/ function lambdaClient($client_id = 0) { *************** *** 94,98 **** /* Verify return results */ ! if(!$result || $result->num_rows != 1) { /* Show a non-fatal error message */ $this->handler->error("Client data for ID ". $this->client_id ." not found!", false); --- 94,98 ---- /* Verify return results */ ! if(!$result || $this->mysqli->num_rows($result) != 1) { /* Show a non-fatal error message */ $this->handler->error("Client data for ID ". $this->client_id ." not found!", false); *************** *** 104,111 **** /* Data ok, now put it into the private data array */ ! $this->data = $result->fetch_assoc(); ! ! /* Free the result */ ! $result->free(); return true; --- 104,108 ---- /* Data ok, now put it into the private data array */ ! $this->data = $this->mysqli->fetch_array($result); return true; *************** *** 211,213 **** --- 208,258 ---- } } + + /** + * Authenticate a client + * + * Receive a loginname and an MD5 encrypted password and verify it against the + * client database. If the client is authenticated, the client data is loaded + * automatically. + * + * @param string login name + * @param string MD5 encrypted password for login name + * @return boolean True when valid client, otherwise false + **/ + function authenticate($loginname, $password) { + /* Prepare and execute SQL query */ + $sql = "SELECT `id` FROM `client` WHERE `login`='".$loginname."' AND `password`='".$password."'"; + $result = $this->mysqli->query($sql); + + if($result && $this->mysqli->num_rows($result) == 1) { + /* Valid client + * Load client data now + */ + $row = $this->mysqli->fetch_array($result); + $this->client_id = $row['id']; + $this->load(); + return true; + } else { + return false; + } + } + + /** + * Check if this client is an admin + * + * @return bool true if admin, otherwise false + **/ + function is_admin() { + return ($this->data['adminflag'] == 'A'); + } + + /** + * Check if this client is an client (non-admin) + * + * @return bool true if client, otherwise false + **/ + function is_client() { + return ($this->data['adminflag'] == 'C'); + } + } |
From: Ariejan de V. <ar...@us...> - 2004-07-08 09:52:18
|
Update of /cvsroot/lambda/lambda/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14548/includes Modified Files: bootstrap.php config.php-dist Log Message: * Added *very* basic GUI * Added client/admin login and logout functionality * Updated stylesheet Index: config.php-dist =================================================================== RCS file: /cvsroot/lambda/lambda/includes/config.php-dist,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** config.php-dist 7 Jul 2004 14:07:44 -0000 1.7 --- config.php-dist 8 Jul 2004 09:52:04 -0000 1.8 *************** *** 90,92 **** /* Temporary directory for Lambda */ define('LAMBDA_TMP', LAMBDA_PATH . "tmp/"); ! ?> --- 90,92 ---- /* Temporary directory for Lambda */ define('LAMBDA_TMP', LAMBDA_PATH . "tmp/"); ! ?> \ No newline at end of file Index: bootstrap.php =================================================================== RCS file: /cvsroot/lambda/lambda/includes/bootstrap.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** bootstrap.php 7 Jul 2004 13:30:51 -0000 1.9 --- bootstrap.php 8 Jul 2004 09:52:04 -0000 1.10 *************** *** 41,44 **** --- 41,51 ---- $handler->debug("Handler class loaded successfully", 2); + /* Include Client Class */ + require(LAMBDA_CLASS . "lambdaClient.class.php"); + + /* Lambda MySQLi Class */ + require(LAMBDA_CLASS . "lambdaMySQLi.class.php"); + $mysqli = @new lambdaMySQLi(); + /* Lambda Session handler */ require(LAMBDA_CLASS . "lambdaSession.class.php"); *************** *** 49,62 **** $template = new lambdaTemplate(); - /* Lambda MySQLi Class */ - require(LAMBDA_CLASS . "lambdaMySQLi.class.php"); - $mysqli = @new lambdaMySQLi(); - /* Include Component Handler */ require(LAMBDA_CLASS . "lambdaComponentHandler.class.php"); $comhandler = new lambdaComponentHandler(); - /* Include Client Class */ - require(LAMBDA_CLASS . "lambdaClient.class.php"); ?> \ No newline at end of file --- 56,63 ---- |
From: Ariejan de V. <ar...@us...> - 2004-07-08 09:52:18
|
Update of /cvsroot/lambda/lambda/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14548/templates Added Files: guiframe.tpl sidebar.tpl siteheader.tpl Log Message: * Added *very* basic GUI * Added client/admin login and logout functionality * Updated stylesheet --- NEW FILE: siteheader.tpl --- {include file="header.tpl"} {$content} {include file="footer.tpl"} --- NEW FILE: sidebar.tpl --- {include file="header.tpl"} {$content} {include file="footer.tpl"} --- NEW FILE: guiframe.tpl --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Lambda</title> <link rel="stylesheet" type="text/css" href="/stylesheet.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <frameset rows="75,100%" frameborder="0"> <frame noresize="noresize" src="siteheader.php" name="siteheader"> <frameset cols="160,100%"> <frame noresize="noresize" src="sidebar.php" name="sidebar"> <frame noresize="noresize" src="overview.php" name="contentpane"> </frameset> </frameset> </html> |
From: Ariejan de V. <ar...@us...> - 2004-07-08 09:52:18
|
Update of /cvsroot/lambda/lambda In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14548 Modified Files: index.php stylesheet.css Added Files: authenticate.php logout.php overview.php sidebar.php siteheader.php Log Message: * Added *very* basic GUI * Added client/admin login and logout functionality * Updated stylesheet --- NEW FILE: sidebar.php --- <?php /** * GUI Sidebar - Navigation and messages to user * @package Lambda * @author Ariejan de Vroom <ar...@la...> * @copyright Copyright (C) 2004 Project Lambda * @version $Id: sidebar.php,v 1.1 2004/07/08 09:52:04 ariejan Exp $ * @link http://lambdahq.net */ include('includes/bootstrap.php'); if(!$session->login()) { header("Location: index.php"); } $content = "Sidebar"; $template->show("sidebar.tpl"); ?> Index: index.php =================================================================== RCS file: /cvsroot/lambda/lambda/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.php 7 Jul 2004 14:46:14 -0000 1.5 --- index.php 8 Jul 2004 09:52:04 -0000 1.6 *************** *** 13,21 **** if(!$session->login()) { ! $content = $template->fetch("login_box.tpl"); } else { ! header("Location: my.php"); } ! $template->show("page.tpl"); ?> \ No newline at end of file --- 13,21 ---- if(!$session->login()) { ! header("Location: authenticate.php"); } else { ! $template->show("guiframe.tpl"); } ! ?> \ No newline at end of file --- NEW FILE: authenticate.php --- <?php /** * Authenticate a client or admin. * @package Lambda * @author Ariejan de Vroom <ar...@la...> * @copyright Copyright (C) 2004 Project Lambda * @version $Id: authenticate.php,v 1.1 2004/07/08 09:52:04 ariejan Exp $ * @link http://lambdahq.net */ require_once('includes/bootstrap.php'); /* Form was not submitted. Show login form */ if(!isset($_POST['submit'])) { $content = $template->fetch("login_box.tpl"); } else { /* Form was submitted. Authenticate as admin or client */ /* Verify that both fields have been filled out */ if(empty($_POST['loginname']) || empty($_POST['password'])) { /* Show an error message */ $content = "<div class='error'>Please enter both your login name and password.</div>"; } else { /* Move loginname and password to local variables. MD5 Encrypt password */ $loginname = $_POST['loginname']; $password = md5($_POST['password']); /* Create a new instance of lambdeClient and try to authenticate the client */ $client = new lambdaClient(); if($client->authenticate($loginname, $password)) { /* Valid user */ $session->register_client($client); header("Location: index.php"); } else { /* Invalid user */ $content = "<div class='error'>Invalid login/password combination!</div>"; } } } $template->show("page.tpl"); ?> --- NEW FILE: logout.php --- <?php /** * Logout a client * @package Lambda * @author Ariejan de Vroom <ar...@la...> * @copyright Copyright (C) 2004 Project Lambda * @version $Id: logout.php,v 1.1 2004/07/08 09:52:04 ariejan Exp $ * @link http://lambdahq.net */ include('includes/bootstrap.php'); if(!$session->login()) { header("Location: index.php"); } $session->logout(); header("Location: index.php"); ?> --- NEW FILE: overview.php --- <?php /** * GUI Site header. General info about Lambda * @package Lambda * @author Ariejan de Vroom <ar...@la...> * @copyright Copyright (C) 2004 Project Lambda * @version $Id: overview.php,v 1.1 2004/07/08 09:52:04 ariejan Exp $ * @link http://lambdahq.net */ include('includes/bootstrap.php'); if(!$session->login()) { header("Location: index.php"); } $content = "<h1>".$client->get('name')."</h1>"; $template->show("page.tpl"); ?> --- NEW FILE: siteheader.php --- <?php /** * GUI Site header. General info about Lambda * @package Lambda * @author Ariejan de Vroom <ar...@la...> * @copyright Copyright (C) 2004 Project Lambda * @version $Id: siteheader.php,v 1.1 2004/07/08 09:52:04 ariejan Exp $ * @link http://lambdahq.net */ include('includes/bootstrap.php'); if(!$session->login()) { header("Location: index.php"); } $content = "<div class='header'>Project Lambda</div>" ."<div class='headerlinks'><a href='logout.php' target='_top'>Logout (".$client->get('login').")</a></div>"; $template->show("siteheader.tpl"); ?> Index: stylesheet.css =================================================================== RCS file: /cvsroot/lambda/lambda/stylesheet.css,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** stylesheet.css 7 Jul 2004 14:46:14 -0000 1.1 --- stylesheet.css 8 Jul 2004 09:52:04 -0000 1.2 *************** *** 4,6 **** --- 4,22 ---- font-size: 11px; color: #000000; + } + .header { + font-size: 24px; + font-weight: bolder; + } + .headerlinks { + float: right; + } + .error { + border: 1px solid #CC0000; + background-color: #FFFFCC; + padding: 5px; + margin: 5px; + font-weight: bold; + color: #FF0000; + font-size: 12px; } \ No newline at end of file |