openfirst-cvscommit Mailing List for openFIRST (Page 9)
Brought to you by:
xtimg
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(41) |
Jun
(210) |
Jul
(39) |
Aug
(153) |
Sep
(147) |
Oct
(173) |
Nov
(81) |
Dec
(163) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(33) |
Feb
(18) |
Mar
|
Apr
(62) |
May
|
Jun
(100) |
Jul
(38) |
Aug
(58) |
Sep
(1) |
Oct
|
Nov
(25) |
Dec
(172) |
2005 |
Jan
(31) |
Feb
(12) |
Mar
(67) |
Apr
(92) |
May
(247) |
Jun
(34) |
Jul
(36) |
Aug
(192) |
Sep
(15) |
Oct
(42) |
Nov
(92) |
Dec
(4) |
2006 |
Jan
|
Feb
(21) |
Mar
|
Apr
|
May
|
Jun
(53) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
(4) |
Apr
(4) |
May
|
Jun
(15) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jamie <ast...@us...> - 2005-10-26 20:15:09
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19904/config Modified Files: version.php Log Message: Something useful now reported, instead of a series of 404's Index: version.php =================================================================== RCS file: /cvsroot/openfirst/base/config/version.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** version.php 16 Oct 2005 22:48:15 -0000 1.11 --- version.php 26 Oct 2005 20:14:59 -0000 1.12 *************** *** 36,40 **** // as posted to php.net manual for glob() function reference. ! function rglob($sDir, $sPattern, $nFlags = NULL) { #$sDir = escapeshellcmd($sDir); //???? --- 36,40 ---- // as posted to php.net manual for glob() function reference. ! /* function rglob($sDir, $sPattern, $nFlags = NULL) { #$sDir = escapeshellcmd($sDir); //???? *************** *** 60,65 **** return $aFiles; ! } ?> --- 60,78 ---- return $aFiles; ! }*/ ! ! $vers = array(); + $base = new BaseModule(); + $vers[$base->getID()] = array( $base->getDir() => $base ); + unset($base); + + foreach($ogModuleManager->getDirs() as $dir) { + $mod = $ogModuleManager->getModuleFromDir($dir); + $id = $mod->getID(); + if (!isset($vers[$id])) $vers[$id] = array(); + $vers[$id][$mod->getDir()] = $mod; + } + unset($dir, $mod, $id); ?> *************** *** 67,85 **** <p>The version as displayed on your pages is <?php echo htmlentities("$Title $Version"); ?></p> ! <p class="warning">This page is broken, and will remain so until the server-side module manager is ! written</p> <table> <thead> ! <tr><th>Status</th><th>File</th><th>Module</th><th>Description</th><th>Link</th></tr> </thead> - <tbody> <?php ! foreach($ogModuleManager->getDirs() as $dir) { ! $mod = $ogModuleManager->getModuleFromDir($dir); ! @include('http://update.openfirst.org/versions.php?version=2&module='.urlencode($mod->getDir()).'&ver='.urlencode($mod->getVersion())); } ?> - </tbody> </table> --- 80,109 ---- <p>The version as displayed on your pages is <?php echo htmlentities("$Title $Version"); ?></p> ! <!--p class="warning">This page is broken, and will remain so until the server-side module manager is ! written</p--> <table> <thead> ! <tr><th>ID</th><th colspan="2">Module</th><th>Version</th><th>Status</th></tr> </thead> <?php ! foreach($vers as $id=>$mods) { ! echo '<tbody>'; ! echo '<tr>'; ! echo '<th rowspan="'.htmlentities(count($mods)).'"><code class="id">'.htmlentities($id).'</code></th>'; ! $first = true; ! foreach($mods as $dir=>$mod) { ! if (!$first) echo '</tr><tr>'; ! $first = false; ! echo '<td>'.htmlentities($mod->getName()).'</td>'; // Label goes here ! echo '<td>(<tt class="file">'.htmlentities($mod->getDir()).'</tt>)</td>'; ! echo '<td>'.$mod->getVersion().'</td>'; ! echo '<td>N/A</td>'; // Version comparison result here. ! } ! echo '</tr>'; ! echo '</tbody> ! '; } ?> </table> |
From: Jamie <ast...@us...> - 2005-10-26 20:10:46
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17294/includes Modified Files: BaseModule.php Log Message: Directory is "config", not "/config" Index: BaseModule.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/BaseModule.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BaseModule.php 19 Oct 2005 03:57:21 -0000 1.2 --- BaseModule.php 26 Oct 2005 20:10:35 -0000 1.3 *************** *** 1,55 **** ! <?php ! /* ! * openFIRST.base - includes/BaseModule.php ! * ! * Copyright (C) 2005, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: Defines the BaseModule class, which extends Module for openfirst.base ! // and serves as a default for $ogCurrentModule. ! ! require_once('Module.php'); ! ! ! class BaseModule extends Module { ! function BaseModule($dir=false) { ! $this->mName = 'openFIRST'; ! $this->mID = 'openfirst.base'; ! $this->mDir = '/config'; ! $this->mVersion = 'CVS'; ! $this->mDate = time(); // Definitive date please? ! $this->mAuthor = 'The openFIRST Team'; ! $this->mMaintainer = 'The openFIRST Team'; ! ! $this->mIncludes = array(); ! $this->mNavBar = false; ! $this->mAdminBar = ofReplaceVariables('<a href="$BasePath/config/index.php" title="Configuration summary">Configuration</a> | ! <a href="$BasePath/config/install.php" title="Install new openFIRST modules">Install Modules</a> | ! <a href="$BasePath/config/modules.php" title="Change basic module options">Module Admin</a> | ! <a href="$BasePath/config/version.php" title="Check for updates to openFIRST and modules">Version Check</a> | ! <a href="http://bugzilla.openfirst.org/" title="Go to Bugzilla and report a problem">Report Bug</a>', $this->getDir()); ! $this->mShow = false; ! $this->mActive = true; ! } ! ! /*static*/ function createFromDir($Dir) { ! return new BaseModule($Dir); ! } ! } ?> \ No newline at end of file --- 1,55 ---- ! <?php ! /* ! * openFIRST.base - includes/BaseModule.php ! * ! * Copyright (C) 2005, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: Defines the BaseModule class, which extends Module for openfirst.base ! // and serves as a default for $ogCurrentModule. ! ! require_once('Module.php'); ! ! ! class BaseModule extends Module { ! function BaseModule($dir=false) { ! $this->mName = 'openFIRST'; ! $this->mID = 'openfirst.base'; ! $this->mDir = 'config'; ! $this->mVersion = 'CVS'; ! $this->mDate = time(); // Definitive date please? ! $this->mAuthor = 'The openFIRST Team'; ! $this->mMaintainer = 'The openFIRST Team'; ! ! $this->mIncludes = array(); ! $this->mNavBar = false; ! $this->mAdminBar = ofReplaceVariables('<a href="$BasePath/config/index.php" title="Configuration summary">Configuration</a> | ! <a href="$BasePath/config/install.php" title="Install new openFIRST modules">Install Modules</a> | ! <a href="$BasePath/config/modules.php" title="Change basic module options">Module Admin</a> | ! <a href="$BasePath/config/version.php" title="Check for updates to openFIRST and modules">Version Check</a> | ! <a href="http://bugzilla.openfirst.org/" title="Go to Bugzilla and report a problem">Report Bug</a>', $this->getDir()); ! $this->mShow = false; ! $this->mActive = true; ! } ! ! /*static*/ function createFromDir($Dir) { ! return new BaseModule($Dir); ! } ! } ?> \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-10-19 22:45:56
|
Update of /cvsroot/openfirst/www/htdocs/image/hackergotchi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16083/www/htdocs/image/hackergotchi Added Files: astronouth7303.png Log Message: Added my image under my SF name. --- NEW FILE: astronouth7303.png --- (This appears to be a binary file; contents omitted.) |
From: Jamie <ast...@us...> - 2005-10-19 06:05:25
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12388/includes Modified Files: edit.php Log Message: Updated names for naming scheme Index: edit.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/edit.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** edit.php 29 Jun 2005 21:20:41 -0000 1.3 --- edit.php 19 Oct 2005 06:05:17 -0000 1.4 *************** *** 1,93 **** ! <?php ! /* ! * openFIRST.base - includes/mdoules.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: Defines the Editor class, which allows a module to create a new ! // markup language and the editor for it, as well as global functions ! // to handle it. ! ! #$ofRegisteredEditors = array(); ! ! /** Registers an editor. ! * Should be handled by a module include. ! * Allows for multiple editors to co-exist. ! * Pass the module dir and the display name. ! */ ! /*function registerEditor($dir, $Name) { ! global $ofRegisteredEditors; ! $ofRegisteredEditors[$dir] = $Name; ! }*/ ! ! /** Selects an editor for use. ! * Should only be called by system, not by ! * modules. ! * @todo Write module code to support this. ! */ ! function selectEditor($dir) { ! global $ogModuleManager; ! $module =& $ogModuleManager->getModuleFromDir($dir); ! if (method_exists($module, 'getEditorObject')) { ! $GLOBALS['ofEditorPlugin'] =& $module->getEditorObject(); ! return true; ! } else { ! // This indicates a serious coding error on the part of the plugin. ! // _Some_ kind of alert is probably needed. ! return false; ! } ! } ! ! /** Handles editors and parsers. ! */ ! class Editor { ! /** Returns the HTML to paste on a page. ! * The return should not be modified in any way, ! * else you may break the software. ! */ ! function getEditField($fieldname,$height,$width,$init) { ! return '<textarea name="'.htmlentities($fieldname).'" cols="'.htmlentities($width).'" rows="'.htmlentities($height).'">'. ! htmlentities($init). ! '</textarea>'; ! } ! ! /** Returns the text posted. ! */ ! function getFieldValue($fieldname) { ! return $_REQUEST[$fieldname]; ! } ! ! /** Returns the plain text version, eg for search indeces. ! * The suggested function of this is to strip markup. ! */ ! function getPlainText($text) { ! return $text; ! } ! ! /** Returns the HTML version for display. ! */ ! function parseText($text) { ! return htmlentities($text); ! } ! } ! ! #Default ! $ofEditorPlugin = new Editor; ! ?> --- 1,93 ---- ! <?php ! /* ! * openFIRST.base - includes/mdoules.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: Defines the Editor class, which allows a module to create a new ! // markup language and the editor for it, as well as global functions ! // to handle it. ! ! #$ofRegisteredEditors = array(); ! ! /** Registers an editor. ! * Should be handled by a module include. ! * Allows for multiple editors to co-exist. ! * Pass the module dir and the display name. ! */ ! /*function registerEditor($dir, $Name) { ! global $ofRegisteredEditors; ! $ofRegisteredEditors[$dir] = $Name; ! }*/ ! ! /** Selects an editor for use. ! * Should only be called by system, not by ! * modules. ! * @todo Write module code to support this. ! */ ! function ofSelectEditor($dir) { ! global $ogModuleManager; ! $module =& $ogModuleManager->getModuleFromDir($dir); ! if (method_exists($module, 'getEditorObject')) { ! $GLOBALS['ofEditorPlugin'] =& $module->getEditorObject(); ! return true; ! } else { ! // This indicates a serious coding error on the part of the plugin. ! // _Some_ kind of alert is probably needed. ! return false; ! } ! } ! ! /** Handles editors and parsers. ! */ ! class Editor { ! /** Returns the HTML to paste on a page. ! * The return should not be modified in any way, ! * else you may break the software. ! */ ! function getEditField($fieldname,$height,$width,$init) { ! return '<textarea name="'.htmlentities($fieldname).'" cols="'.htmlentities($width).'" rows="'.htmlentities($height).'">'. ! htmlentities($init). ! '</textarea>'; ! } ! ! /** Returns the text posted. ! */ ! function getFieldValue($fieldname) { ! return $_REQUEST[$fieldname]; ! } ! ! /** Returns the plain text version, eg for search indeces. ! * The suggested function of this is to strip markup. ! */ ! function getPlainText($text) { ! return $text; ! } ! ! /** Returns the HTML version for display. ! */ ! function parseText($text) { ! return htmlentities($text); ! } ! } ! ! #Default ! $ogEditorPlugin = new Editor; ! ?> |
From: Jamie <ast...@us...> - 2005-10-19 04:19:36
|
Update of /cvsroot/openfirst/awards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30748/awards Modified Files: openfirst.info.xml Log Message: case change in PRIMARY key Index: openfirst.info.xml =================================================================== RCS file: /cvsroot/openfirst/awards/openfirst.info.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** openfirst.info.xml 12 Sep 2005 01:42:55 -0000 1.8 --- openfirst.info.xml 19 Oct 2005 04:19:28 -0000 1.9 *************** *** 38,42 **** </fields> <keys> ! <key type="primary"> <col>ID</col> </key> --- 38,42 ---- </fields> <keys> ! <key type="PRIMARY"> <col>ID</col> </key> |
From: Jamie <ast...@us...> - 2005-10-19 04:18:52
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30628/config Modified Files: openfirst.info.xml Log Message: Commented out numeric ID fields (should implement them at some point) Index: openfirst.info.xml =================================================================== RCS file: /cvsroot/openfirst/base/config/openfirst.info.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** openfirst.info.xml 12 Sep 2005 01:35:29 -0000 1.6 --- openfirst.info.xml 19 Oct 2005 04:18:44 -0000 1.7 *************** *** 1,103 **** ! <?xml version="1.0"?> ! <module xmlns="http://openfirst.org/xml/module/1.0" id="openfirst.base"> ! <!-- NOTE: This file defines the basic DB layout when installing or upgrading. ! openfirst.base is a psuedo-module for the oF core. --> ! <name>openFIRST portal system</name> ! <version>CVS</version> ! <author>The openFIRST Team</author> ! ! <includes> ! <include>$fBasePath/includes/settings.php</include> ! <include>$fBasePath/includes/slug.php</include> ! </includes> ! ! <!-- Database setup --> ! <db> ! <table name="config"> ! <fields> ! <field name="c_id" null="no" autoincrement="yes"><type unsigned="yes">int</type></field> ! <field name="modulename" null="no"><type length="25">varchar</type> <default></default></field> ! <field name="dir" null="no"><type length="25">varchar</type></field> ! <field name="UpdateDate" null="no"><type>datetime</type></field> ! <field name="label" ><type length="25">varchar</type></field> ! <field name="Author" ><type>tinytext</type></field> ! <field name="Maintainer" ><type>tinytext</type></field> ! <field name="version" null="no"><type length="10">varchar</type> <default>CVS</default></field> ! <field name="showonmenu" null="no"><type>BOOL</type> <default>0</default></field> ! <field name="active" null="no"><type>BOOL</type> <default>0</default></field> ! <field name="adminnavigation" ><type>text</type></field> ! <field name="modulenavigation" ><type>text</type></field> ! <field name="includes" ><type>text</type></field> ! </fields> ! <keys> ! <key type="primary"> ! <col>dir</col> ! </key> ! </keys> ! </table> ! ! <table name="members"> ! <fields> ! <field name="m_id" null="no" autoincrement="yes"><type unsigned="yes">int</type></field> ! <field name="user" null="no"><type length="128">varchar</type></field> ! <field name="firstname"><type>tinytext</type></field> ! <field name="lastname"><type>tinytext</type></field> ! <field name="lastseen"><type>datetime</type></field> ! <field name="ip"><type>tinytext</type></field> ! <field name="password"><type>text</type></field> ! <field name="authcode"><type>text</type></field> ! <field name="membertype"><type>tinytext</type></field> ! <field name="division"><type>tinytext</type></field> ! <field name="year"><type>year</type></field> ! <field name="email"><type>text</type></field> ! <field name="icq"><type length="11">int</type></field> ! <field name="aim"><type>tinytext</type></field> ! <field name="msn"><type>tinytext</type></field> ! <field name="yim"><type>tinytext</type></field> ! <field name="jabber"><type>tinytext</type></field> ! <field name="description"><type>text</type></field> ! <field name="signature"><type>tinytext</type></field> ! <field name="dateregistered"><type>datetime</type></field> ! <field name="picturelocation"><type>tinytext</type></field> ! <field name="team"><type length="11">int</type></field> ! <field name="skills"><type>text</type></field> ! </fields> ! <keys> ! <key name="user" type="unique"> ! <col>user</col> ! </key> ! </keys> ! </table> ! ! <table name="sitesettings"> ! <fields> ! <field name="ss_module" null="no"><type unsigned="yes">int</type></field> ! <field name="ss_setting" null="no"><type length="25">varchar</type></field> ! <field name="ss_value"><type>longtext</type><default></default></field> ! </fields> ! <keys> ! <key name="PRIMARY"> ! <col>ss_module</col> ! <col>ss_setting</col> ! </key> ! </keys> ! </table> ! ! <table name="usersettings"> ! <fields> ! <field name="us_user" null="no"><type unsigned="yes">int</type></field> ! <field name="us_module" null="no"><type unsigned="yes">int</type></field> ! <field name="us_setting" null="no"><type length="25">varchar</type></field> ! <field name="us_value"><type>longtext</type><default></default></field> ! </fields> ! <keys> ! <key name="PRIMARY"> ! <col>us_user</col> ! <col>us_module</col> ! <col>us_setting</col> ! </key> ! </keys> ! </table> ! ! </db> ! </module> --- 1,103 ---- ! <?xml version="1.0"?> ! <module xmlns="http://openfirst.org/xml/module/1.0" id="openfirst.base"> ! <!-- NOTE: This file defines the basic DB layout when installing or upgrading. ! openfirst.base is a psuedo-module for the oF core. --> ! <name>openFIRST portal system</name> ! <version>CVS</version> ! <author>The openFIRST Team</author> ! ! <includes> ! <include>$fBasePath/includes/settings.php</include> ! <include>$fBasePath/includes/slug.php</include> ! </includes> ! ! <!-- Database setup --> ! <db> ! <table name="config"> ! <fields> ! <!--field name="c_id" null="no" autoincrement="yes"><type unsigned="yes">int</type></field--> ! <field name="modulename" null="no"><type length="25">varchar</type> <default></default></field> ! <field name="dir" null="no"><type length="25">varchar</type></field> ! <field name="UpdateDate" null="no"><type>datetime</type></field> ! <field name="label" ><type length="25">varchar</type></field> ! <field name="Author" ><type>tinytext</type></field> ! <field name="Maintainer" ><type>tinytext</type></field> ! <field name="version" null="no"><type length="10">varchar</type> <default>CVS</default></field> ! <field name="showonmenu" null="no"><type>BOOL</type> <default>0</default></field> ! <field name="active" null="no"><type>BOOL</type> <default>0</default></field> ! <field name="adminnavigation" ><type>text</type></field> ! <field name="modulenavigation" ><type>text</type></field> ! <field name="includes" ><type>text</type></field> ! </fields> ! <keys> ! <key type="primary"> ! <col>dir</col> ! </key> ! </keys> ! </table> ! ! <table name="members"> ! <fields> ! <!--field name="m_id" null="no" autoincrement="yes"><type unsigned="yes">int</type></field--> ! <field name="user" null="no"><type length="128">varchar</type></field> ! <field name="firstname"><type>tinytext</type></field> ! <field name="lastname"><type>tinytext</type></field> ! <field name="lastseen"><type>datetime</type></field> ! <field name="ip"><type>tinytext</type></field> ! <field name="password"><type>text</type></field> ! <field name="authcode"><type>text</type></field> ! <field name="membertype"><type>tinytext</type></field> ! <field name="division"><type>tinytext</type></field> ! <field name="year"><type>year</type></field> ! <field name="email"><type>text</type></field> ! <field name="icq"><type length="11">int</type></field> ! <field name="aim"><type>tinytext</type></field> ! <field name="msn"><type>tinytext</type></field> ! <field name="yim"><type>tinytext</type></field> ! <field name="jabber"><type>tinytext</type></field> ! <field name="description"><type>text</type></field> ! <field name="signature"><type>tinytext</type></field> ! <field name="dateregistered"><type>datetime</type></field> ! <field name="picturelocation"><type>tinytext</type></field> ! <field name="team"><type length="11">int</type></field> ! <field name="skills"><type>text</type></field> ! </fields> ! <keys> ! <key name="user" type="unique"> ! <col>user</col> ! </key> ! </keys> ! </table> ! ! <table name="sitesettings"> ! <fields> ! <field name="ss_module" null="no"><type unsigned="yes">int</type></field> ! <field name="ss_setting" null="no"><type length="25">varchar</type></field> ! <field name="ss_value"><type>longtext</type><default></default></field> ! </fields> ! <keys> ! <key name="PRIMARY"> ! <col>ss_module</col> ! <col>ss_setting</col> ! </key> ! </keys> ! </table> ! ! <table name="usersettings"> ! <fields> ! <field name="us_user" null="no"><type unsigned="yes">int</type></field> ! <field name="us_module" null="no"><type unsigned="yes">int</type></field> ! <field name="us_setting" null="no"><type length="25">varchar</type></field> ! <field name="us_value"><type>longtext</type><default></default></field> ! </fields> ! <keys> ! <key name="PRIMARY"> ! <col>us_user</col> ! <col>us_module</col> ! <col>us_setting</col> ! </key> ! </keys> ! </table> ! ! </db> ! </module> |
From: Jamie <ast...@us...> - 2005-10-19 04:18:09
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30498/config Modified Files: modules.php Log Message: Updated for module system (no direct queries anymore) Index: modules.php =================================================================== RCS file: /cvsroot/openfirst/base/config/modules.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** modules.php 16 Oct 2005 22:48:15 -0000 1.10 --- modules.php 19 Oct 2005 04:18:00 -0000 1.11 *************** *** 1,100 **** ! <?php ! /* ! * openFIRST.base - config/modules.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Dave DiBiase <dav...@ea...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: configure OpenFIRST modules, including their position on menus ! ! include("../includes/globals.php"); ! $ogUser->mustBeAdmin(); ! include($Header); ! ! // Check if user wishes to make updates ! if(isset($_POST['update'])) { ! ! // Query for current module information and loop through with while ! $query = ofirst_dbquery("SELECT * FROM ofirst_config"); ! while($module = ofirst_dbfetch_object($query)){ ! // Set values to update db for checkboxes ! if(isset($_POST[$module->modulename.'-active'])) { $active = "1"; } else { $active = "0"; } ! if(isset($_POST[$module->modulename.'-showonmenu'])){ $showonmenu = "1"; } else { $showonmenu = "0"; } ! ! // Creater query string then update information in database ! ofirst_dbquery("UPDATE ofirst_config SET ! modulename = '".$_POST[$module->modulename.'-modulename']."', ! includes = '".$_POST[$module->modulename.'-includes']."', ! showonmenu = '".$showonmenu."', ! active = '".$active."' WHERE modulename = '".$module->modulename."'") or die(ofirst_dberror()); ! } ! ! // Successful creation response and die with footers. ! echo "<p>Module information has been updated, thank you. [ <a href='modules.php'>Modules</a> ]</p>"; ! include($Footer); ! die; ! ! } ! ?> ! ! <h1>Module Administrator</h1> ! <p>This utility will allow you to manage modules for certain openFIRST components.<br> ! This includes enabling them, and setting them to be displayed on the menus.</p> ! ! <?php ! // Get module information and output values ! $mods = $ogModuleManager->getDirs(); ! // Make sure that module exists (bug #124) ! if (count($mods) == 0) ! { ! echo "<p class='error'>Please install modules before administrating them! [ <a href='install.php'>Install Component</a> ]</p>"; ! include($footer); ! die; ! } ! ?> ! <form method="post" action="modules.php"> ! <table> ! <tr> ! <th>Module Name</th> ! <th>Activate</th> ! <th>Show Menu</th> ! </tr> ! <?php ! foreach($mods as $dir) { ! $mod = $ogModuleManager->getModuleFromDir($dir); ! ?> ! <tr> ! <td><input name="<?php echo $mod->getDir(); ?>-modulename" type="text" id="modulename" value="<?php echo $mod->getName(); ?>"></td> ! <td bgcolor='<?php if ($mod->getActive()){ echo "#00FF00"; } else { echo "red"; } ?>'><input name="<?php echo $mod->getDir(); ?>-active" type="checkbox" id="active" value="checkbox" <?php if ($mod->getActive()) { echo "checked='checked'"; } ?>></td> ! <td bgcolor='<?php if ($mod->getShowOnMenu()) { echo "#00FF00"; } else { echo "red"; } ?>'><input name="<?php echo $mod->getDir(); ?>-showonmenu" type="checkbox" id="showonmenu" value="checkbox" <?php if($module->getShowOnMenu()) { echo "checked='checked'"; } ?>></td> ! </tr> ! <?php ! } ! ?> ! </table> ! <br> ! <input type="submit" name="update" value="Update Values" /> ! </form> ! ! <?php include($Footer); ?> \ No newline at end of file --- 1,105 ---- ! <?php ! /* ! * openFIRST.base - config/modules.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Dave DiBiase <dav...@ea...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: configure OpenFIRST modules, including their position on menus ! ! include("../includes/globals.php"); ! $ogUser->mustBeAdmin(); ! include($Header); ! ! // Check if user wishes to make updates ! if(isset($_POST['update'])) { ! ! // Query for current module information and loop through with while ! foreach($ogModuleManager->getDirs() as $dir) { ! $mod = $ogModuleManager->getModuleFromDir($dir); ! $name = $mod->getDir(); ! // Set values to update db for checkboxes ! if ( isset($_POST[$name.'-active']) ) { ! $active = true; ! ! } else { ! $active = false; ! } ! $mod->setActive($active); ! if( isset($_POST[$name.'-showonmenu']) ) { ! $showonmenu = true; ! } else { ! $showonmenu = false; ! } ! $mod->setShowOnMenu($showonmenu); ! } ! ! // Successful creation response and die with footers. ! echo "<p>Module information has been updated, thank you. [ <a href='modules.php'>Modules</a> ]</p>"; ! include($Footer); ! die; ! ! } ! ?> ! ! <h1>Module Administrator</h1> ! <p>This utility will allow you to manage modules for certain openFIRST components.<br> ! This includes enabling them, and setting them to be displayed on the menus.</p> ! ! <?php ! // Get module information and output values ! $mods = $ogModuleManager->getDirs(); ! // Make sure that module exists (bug #124) ! if (count($mods) == 0) ! { ! echo "<p class='error'>Please install modules before administrating them! [ <a href='install.php'>Install Component</a> ]</p>"; ! include($footer); ! die; ! } ! ?> ! <form method="post" action="modules.php"> ! <table> ! <tr> ! <th>Module Name</th> ! <th>Activate</th> ! <th>Show Menu</th> ! </tr> ! <?php ! foreach($mods as $dir) { ! $mod = $ogModuleManager->getModuleFromDir($dir); ! ?> ! <tr> ! <td><input name="<?php echo $mod->getDir(); ?>-modulename" type="text" id="modulename" value="<?php echo $mod->getName(); ?>"></td> ! <td bgcolor='<?php if ($mod->getActive()){ echo "#00FF00"; } else { echo "red"; } ?>'><input name="<?php echo $mod->getDir(); ?>-active" type="checkbox" id="active" value="checkbox" <?php if ($mod->getActive()) { echo "checked='checked'"; } ?>></td> ! <td bgcolor='<?php if ($mod->getShowOnMenu()) { echo "#00FF00"; } else { echo "red"; } ?>'><input name="<?php echo $mod->getDir(); ?>-showonmenu" type="checkbox" id="showonmenu" value="checkbox" <?php if($module->getShowOnMenu()) { echo "checked='checked'"; } ?>></td> ! </tr> ! <?php ! } ! ?> ! </table> ! <br> ! <input type="submit" name="update" value="Update Values" /> ! </form> ! ! <?php include($Footer); ?> \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-10-19 04:17:18
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30352/config Modified Files: install.php Log Message: -Updated for module system (no direct queries) -Proper error reporting on failure Index: install.php =================================================================== RCS file: /cvsroot/openfirst/base/config/install.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** install.php 16 Oct 2005 22:48:15 -0000 1.27 --- install.php 19 Oct 2005 04:17:09 -0000 1.28 *************** *** 1,127 **** ! <?php ! /* ! * openFIRST.base - config/install.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@po...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: set up OpenFIRST modules ! ! include_once("../includes/globals.php"); ! $ogUser->mustBeAdmin(); ! include_once('xmlModule.php'); ! include_once($Header); ! ! ini_set("max_execution_time", 600); // Bypass problem of timeouts when many modules are installed ! // 10 minutes should be sufficient, even for remote database servers ! ! ?> ! ! <h1>Module Installer</h1> ! <p>This utility will create the tables required for certain openFIRST components ! to run.<br /> ! Select the modules you would like to install.<br /> ! <br /> ! <span style="color:red;">Once installed, modules must be enabled from the <a href="modules.php"><strong>Module ! Administrator</strong></a>.</span></p> ! ! <?php ! ! $InstalledModules = $ogModuleManager->getDirs(); ! ! $Modules = array(); ! ! $files = glob("$fBasePath/*/openfirst.info.xml"); ! if (count($files) < 1) { ! ?> ! <p class="error">You have no modules to install or are misconfigured. You can go to <a href="http://www.openfirst.org/">openFIRST.org</a> ! to download them.</p> ! <?php ! include($Footer); ! die(); ! } ! ! foreach($files as $file) { ! $mod = xmlModule::createFromFile($file); ! $Modules[$mod->getDir()] = $mod; ! } ! ! ?> ! <form method="post" action="install.php"> ! <table id="moduleInstall"> ! <colgroup> ! <col /> ! <col /> ! <col class="file" /> ! </colgroup> ! <colgroup> ! <col /> ! </colgroup> ! <thead> ! <tr><th colspan="3">Module</th><th>Status</th></tr> ! </thead> ! <tbody> ! <?php ! ! # Get the meta data ! foreach($Modules as $mod) { ! if ($mod->isBase()) { ! // Hide openfirst.base ! continue; ! } ! ! $dir = $mod->getDir(); ! ! $WasInstalled = $IsInstalled = in_array($dir, $InstalledModules); ! $InstallFailed = $UpgradeFailed = false; ! if(isset($_POST[$dir]) && $_POST[$dir] == "on" && !$IsInstalled) { ! if ($mod->install()) { ! $IsInstalled = true; ! } else { ! $InstallFailed = true; ! } ! } ! echo '<tr><td><input type="checkbox" name="'.htmlentities($dir).'" '; ! if ($IsInstalled) echo 'checked="checked" '; ! echo '/><label for="'.htmlentities($dir).'">'.htmlentities($mod->getName()).'</label></td> ! <td>('.htmlentities($mod->getVersion()).')'.'</td> ! <td>'.htmlentities($dir)."</td>"; ! ! if ($IsInstalled && !$WasInstalled) { ! echo('<td style="background-color: lime; color:black; font-weight:bold;">Module Installation succeeded!</td></tr>'); ! } else if ($InstallFailed) { ! echo('<td style="background-color: red; color:black; font-weight:bold;">Module Installation failed!</td></tr>'); ! } else if ($IsInstalled && $WasInstalled) { ! echo('<td style="background-color: green; color:white;">Module Installed</td></tr>'); ! } else { ! echo('<td style="background-color: gray; color:white;">Module available</td></tr>'); ! } ! } ! ?> ! </table> ! <br /><input type="submit" value="Install Modules" /> ! </form> ! ! <?php ! include($Footer); ?> \ No newline at end of file --- 1,127 ---- ! <?php ! /* ! * openFIRST.base - config/install.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@po...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: set up OpenFIRST modules ! ! include_once("../includes/globals.php"); ! $ogUser->mustBeAdmin(); ! include_once('xmlModule.php'); ! include_once($Header); ! ! ini_set("max_execution_time", 600); // Bypass problem of timeouts when many modules are installed ! // 10 minutes should be sufficient, even for remote database servers ! ! ?> ! ! <h1>Module Installer</h1> ! <p>This utility will create the tables required for certain openFIRST components ! to run.<br /> ! Select the modules you would like to install.<br /> ! <br /> ! <span style="color:red;">Once installed, modules must be enabled from the <a href="modules.php"><strong>Module ! Administrator</strong></a>.</span></p> ! ! <?php ! ! $InstalledModules = $ogModuleManager->getDirs(); ! ! $Modules = array(); ! ! $files = glob("$fBasePath/*/openfirst.info.xml"); ! if (count($files) < 1) { ! ?> ! <p class="error">You have no modules to install or are misconfigured. You can go to <a href="http://www.openfirst.org/">openFIRST.org</a> ! to download them.</p> ! <?php ! include($Footer); ! die(); ! } ! ! foreach($files as $file) { ! $mod = xmlModule::createFromFile($file); ! $Modules[$mod->getDir()] = $mod; ! } ! ! ?> ! <form method="post" action="install.php"> ! <table id="moduleInstall"> ! <colgroup> ! <col /> ! <col /> ! <col class="file" /> ! </colgroup> ! <colgroup> ! <col /> ! </colgroup> ! <thead> ! <tr><th colspan="3">Module</th><th>Status</th></tr> ! </thead> ! <tbody> ! <?php ! ! # Get the meta data ! foreach($Modules as $mod) { ! if ($mod->isBase()) { ! // Hide openfirst.base ! continue; ! } ! ! $dir = $mod->getDir(); ! ! $WasInstalled = $IsInstalled = in_array($dir, $InstalledModules); ! $InstallFailed = $UpgradeFailed = false; ! if(isset($_POST[$dir]) && $_POST[$dir] == "on" && !$IsInstalled) { ! if (($err = $mod->install()) === true) { ! $IsInstalled = true; ! } else { ! $InstallFailed = true; ! } ! } ! echo '<tr><td><input type="checkbox" name="'.htmlentities($dir).'" '; ! if ($IsInstalled) echo 'checked="checked" '; ! echo '/><label for="'.htmlentities($dir).'">'.htmlentities($mod->getName()).'</label></td> ! <td>('.htmlentities($mod->getVersion()).')'.'</td> ! <td>'.htmlentities($dir)."</td>"; ! ! if ($IsInstalled && !$WasInstalled) { ! echo('<td style="background-color: lime; color:black; font-weight:bold;">Module Installation succeeded!</td></tr>'); ! } else if ($InstallFailed) { ! echo('<td style="background-color: red; color:black; font-weight:bold;">Module Installation failed:<br/>'.htmlentities($err).'</td></tr>'); ! } else if ($IsInstalled && $WasInstalled) { ! echo('<td style="background-color: green; color:white;">Module Installed</td></tr>'); ! } else { ! echo('<td style="background-color: gray; color:white;">Module available</td></tr>'); ! } ! } ! ?> ! </table> ! <br /><input type="submit" value="Install Modules" /> ! </form> ! ! <?php ! include($Footer); ?> \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-10-19 04:16:24
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30263/config Modified Files: index.php Log Message: aesthetic changes. Index: index.php =================================================================== RCS file: /cvsroot/openfirst/base/config/index.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** index.php 16 Oct 2005 22:48:15 -0000 1.16 --- index.php 19 Oct 2005 04:16:14 -0000 1.17 *************** *** 1,92 **** ! <?php ! /* ! * openFIRST.base - config/index.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@po...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: Provide a control center for configuration activities. ! ! include("../includes/globals.php"); ! $ogUser->mustBeAdmin(); ! include_once($Header); ! ! ?> ! <h1>openFIRST Configuration Area</h1> ! ! <table width="50%"> ! <tr> ! <th>Administrative Options</th> ! </tr> ! </table> ! ! <?php ! if(is_writable("$fBasePath/includes/sitesettings.php") && file_exists("$fBasePath/includes/first.php")) { ! echo("<p><strong>Warning</strong>: Your sitesettings.php file is writable by the web user. Also, first.php is still in existance. After you have setup the openFIRST web portal system, it is safe to remove first.php. Removing first.php prevents the accidental reset of configuration information and prevents external users from altering your configuration. For maximal security, you should also change the filesystem permissions so that sitesettings.php is not writable by the web user."); ! } elseif(is_writable("$fBasePath/includes/sitesettings.php")) { ! echo("<p><strong>Warning</strong>: Your sitesettings.php file is writable by the web user. For maximal security, you should change the filesystem permissions to correct this.</p>"); ! } ! ?> ! ! <table> ! <tr> ! <th colspan="2">Statistics</th> ! </tr> ! <tr> ! <th>Database Version</th><td> ! <?php ! // The statistics feature is loosely inspired by that of phpBB. ! echo $ogDB->getVersion(); ! ?></td> ! </tr> ! <tr> ! <th>Database Size</th><td> ! <?php ! echo $ogDB->getSize(); ! ?> ! </td> ! </tr> ! <tr><th>openFIRST Project Statistics</th><td> ! <script type='application/x-javascript' src='http://bugzilla.openfirst.org/openfirst/bugcrushers.php?style=js'></script> ! </td></tr> ! </table> ! ! <br> ! <table width="50%"> ! <tr> ! <td width="30%" valign="top"><a href="version.php">Version Check</a></td> ! <td width="70%" valign="top">Ensure that your version of the openFIRST web ! portal software and any 3rd party extensions is up to date</td> ! </tr> ! <tr> ! <td valign="top"><a href="install.php">Install Component</a></td> ! <td valign="top">Required to install several new openFIRST modules.</td> ! </tr> ! <tr> ! <td valign="top"><a href="modules.php">Module Administrator</a></td> ! <td valign="top">Required to manage openFIRST modules.</td> ! </tr> ! </table> ! <?php ! include($Footer); ?> \ No newline at end of file --- 1,104 ---- ! <?php ! /* ! * openFIRST.base - config/index.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@po...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: Provide a control center for configuration activities. ! ! include("../includes/globals.php"); ! $ogUser->mustBeAdmin(); ! include_once($Header); ! ! ?> ! <h1>openFIRST Configuration Area</h1> ! ! <table width="50%"> ! <tr> ! <th>Administrative Options</th> ! </tr> ! </table> ! ! <?php ! if(is_writable("$fBasePath/includes/sitesettings.php") && file_exists("$fBasePath/includes/first.php")) { ! echo "<p class='warning'><strong>Warning</strong>: Your ! <span class='file'>sitesettings.php</span> file is writable by the web user. ! Also, <span class='file'>first.php</span> is still in existance. After you ! have setup the openFIRST web portal system, it is safe to remove ! <span class='file'>first.php</span>. Removing ! <span class='file'>first.php</span> prevents the accidental reset of ! configuration information and prevents external users from altering your ! configuration. For maximal security, you should also change the filesystem ! permissions so that <span class='file'>sitesettings.php</span> is not ! writable by the web user."; ! } elseif(is_writable("$fBasePath/includes/sitesettings.php")) { ! echo "<p class='warning'><strong>Warning</strong>: Your ! <span class='file'>sitesettings.php</span> file is writable by the web user. ! For maximal security, you should change the filesystem permissions to correct ! this.</p>"; ! } ! ?> ! ! <table> ! <tr> ! <th colspan="2">Statistics</th> ! </tr> ! <tr> ! <th>Database Version</th><td> ! <?php ! // The statistics feature is loosely inspired by that of phpBB. ! echo $ogDB->getVersion(); ! ?></td> ! </tr> ! <tr> ! <th>Database Size</th><td> ! <?php ! echo $ogDB->getSize(); ! ?> ! </td> ! </tr> ! <tr><th>openFIRST Project Statistics</th><td> ! <script type='application/x-javascript' src='http://bugzilla.openfirst.org/openfirst/bugcrushers.php?style=js'></script> ! </td></tr> ! </table> ! ! <br/> ! <table width="50%"> ! <tr> ! <td valign="top"><a href="install.php">Install Modules</a></td> ! <td valign="top">Required to install several new openFIRST modules.</td> ! </tr> ! <tr> ! <td valign="top"><a href="modules.php">Module Administrator</a></td> ! <td valign="top">Required to manage openFIRST modules.</td> ! </tr> ! <tr> ! <td width="30%" valign="top"><a href="version.php">Version Check</a></td> ! <td width="70%" valign="top">Ensure that your version of the openFIRST and ! modules are up to date</td> ! </tr> ! </table> ! <?php ! include($Footer); ?> \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-10-19 04:15:34
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30142/config Modified Files: first.php Log Message: -Removed login, instead have link to config/index.php -Removed references to base.sql -Uses openfirst.info.xml for DB installation -Moved inclusion of globals.php to after writing sitesettings.php (submital only) -Some better error printing. Index: first.php =================================================================== RCS file: /cvsroot/openfirst/base/config/first.php,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** first.php 18 Jul 2005 22:39:50 -0000 1.64 --- first.php 19 Oct 2005 04:15:25 -0000 1.65 *************** *** 34,49 **** // Initialize header/footer vars $Title = 'openFIRST Installation'; ! $StylePath = 'http://openfirst.sourceforge.net/'; ! - if(isset($_POST["login"])) { - require_once('../includes/globals.php'); - InitUser(); - // User is attempting to login for the first time. - if (isset($user)) { - die("<br /><br /><br />You have successfully logged in. <a href='index.php'>Access Administrative Configuration Options</a> (you will be prompted for your password again)</center>"); - } - } - define('OPENFIRST_INSTALLATION_SCRIPT', true); // Only define if it's the installation script --- 34,39 ---- // Initialize header/footer vars $Title = 'openFIRST Installation'; ! $StylePath = 'http://openfirst.sourceforge.net'; define('OPENFIRST_INSTALLATION_SCRIPT', true); // Only define if it's the installation script *************** *** 54,62 **** $sqldatabase = $_POST["sqldatabase"]; $fbasepath = realpath($_POST['fbasepath']); - include_once("$fbasepath/includes/globals.php"); - - #HACK: Change when module installationg code is written - if (!$ogDB->execFile('base.sql')) - echo 'DB/tables creation error: '.$ogDB->error(); function GetVarValue($var) { --- 44,47 ---- *************** *** 117,130 **** $hfile = fopen("$ConfigFile",'w'); fwrite($hfile, $file); fclose($hfile); ! include_once($header); ! echo("<div class=\"success\"><h1>openFIRST Software Configured</h1> <p>If this page does not display errors elsewhere, then your openFIRST has now been successfully configured. If there are errors, check your configuration options and try again. You may now wish to change the permissions on <span class=\"file\">".htmlentities(basename($ConfigFile))."</span> to prevent unwanted changes ! to the configuration options. You should be able to login below using the username <b class=\"user\">admin</b> and the password <b class=\"password\">openfirst</b>, if not, then either the password for that account has been changed, or the MySQL settings are incorrect.</p>"); ! showlogin(); ! include_once($footer) die; } else { --- 102,135 ---- $hfile = fopen("$ConfigFile",'w'); fwrite($hfile, $file); fclose($hfile); ! // We write the settings file before including globals.php ! ! include_once("$fbasepath/includes/globals.php"); ! require_once("$fbasepath/includes/xmlModule.php"); ! $base = xmlModule::createFromFile(dirname(__FILE__).'/openfirst.info.xml'); ! ! include_once($Header); ! // This a series of statements, each of which are executed. If an error condition occurs, that ! // branch is ran. ! if (!$ogDB->createDB($ogSQLDatabase, $ogSQLTablePrefix)) { ! // Do this as an optional root user? ! echo '<p class="error">DB creation error: '.htmlentities($ogDB->errorString()).'</p>'; ! } else if (($err = $base->install()) !== true) { ! echo '<p class="error">Tables creation error: '.htmlentities($err).'</p>'; ! echo '<pre>'.htmlentities($ogLastQuery).'</pre>'; ! } else if (($ogUser = User::createNewUser('admin', 'openfirst')) == null) { ! echo '<p class="error">Error creating user: '.htmlentities($ogDB->errorString()).'</p>'; ! } else { ! $ogUser->addGroup(ugADMIN); ! $ogUser->saveData(); ! echo("<div class=\"success\"><h1>openFIRST Software Configured</h1> <p>If this page does not display errors elsewhere, then your openFIRST has now been successfully configured. If there are errors, check your configuration options and try again. You may now wish to change the permissions on <span class=\"file\">".htmlentities(basename($ConfigFile))."</span> to prevent unwanted changes ! to the configuration options. You should be able to login using the username <b class=\"user\">admin</b> and the password <b class=\"password\">openfirst</b>, if not, then either the password for that account has been changed, or the MySQL settings are incorrect.</p>"); ! echo '<p class="big">Continue to the <a href="'.htmlentities($BasePath).'/config/">administration page</a>.</p>'; ! } ! include_once($Footer); die; } else { |
From: Jamie <ast...@us...> - 2005-10-19 04:12:31
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29756/includes Modified Files: globals.php sitesettings.tpl Log Message: -Changed names of DB settings to match format -Fixed some installation issues in globals.php. Index: sitesettings.tpl =================================================================== RCS file: /cvsroot/openfirst/base/includes/sitesettings.tpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sitesettings.tpl 23 Aug 2005 17:41:24 -0000 1.4 --- sitesettings.tpl 19 Oct 2005 04:12:21 -0000 1.5 *************** *** 8,23 **** * database, in the ofirst_config table. */ - $DBaseType = %DBTYPE%; ! $Encryption = %ENCRYPT%; $Title = %TITLE%; $Version = %VER%; ! $sqlServer = %DBSERVER%; ! $sqlUser = %DBUSER%; ! $sqlPassword = %DBPASS%; ! $sqlDatabase = %DBNAME%; ! $PassSaveDisabled = %COOKIE%; $regEnabled = %REG%; $Server = %SERVER%; --- 8,25 ---- * database, in the ofirst_config table. */ ! $ogEncryptionType = %ENCRYPT%; $Title = %TITLE%; $Version = %VER%; ! ! $ogSQLServer = %DBSERVER%; ! $ogDataBaseType = %DBTYPE%; ! $ogSQLUser = %DBUSER%; ! $ogSQLPassword = %DBPASS%; ! $ogSQLDatabase = %DBNAME%; ! $ogSQLTablePrefix = 'ofirst_'; ! $ogPasswordSaveEnabled = !(%COOKIE%); $regEnabled = %REG%; $Server = %SERVER%; Index: globals.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/globals.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** globals.php 16 Oct 2005 22:44:10 -0000 1.16 --- globals.php 19 Oct 2005 04:12:21 -0000 1.17 *************** *** 1,211 **** ! <?php ! /* ! * openFIRST.base - includes/globals.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@po...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! ! // Purpose: Initialize the openFIRST system. ! ! $configdir = dirname(__FILE__); ! if( !defined('OPENFIRST_NO_INSTALLATION') && !file_exists( "$configdir/sitesettings.php" ) ) { ! $path = "#"; ! if(file_exists("../config/first.php")) { ! $path = "../config/first.php"; ! } elseif(file_exists("config/first.php")) { ! $path = "config/first.php"; ! } elseif(file_exists("../../config/first.php")) { ! $path = "../../config/first.php"; ! } ! $path = htmlentities($path); ! die( "You'll have to <a href=\"$path\">set openFIRST up</a> first!" ); ! } ! ! if (defined('OPENFIRST_NO_INSTALLATION')) { ! if(is_readable("style/headers.php")) { ! $Header = "style/headers.php"; ! } else { ! $Header = "../style/headers.php"; ! } ! } ! ! define('osUNIX', 'unix'); ! define('osWINDOWS', 'windows'); ! #Add more operating systems here ! ! if (substr(PHP_OS, 0, 3) == 'WIN') { ! $osType = osWINDOWS; ! } else { ! $osType = osUNIX; ! } ! ! #Because of the differences between versions, this may be needed. ! $usingPHP5 = version_compare(PHP_VERSION, '5.0.0', '>='); ! ! require_once('compatibility.php'); ! ! /** URL of the server. It will be automaticly build including https mode */ ! $ogServer = ''; ! ! if( isset( $_SERVER['SERVER_NAME'] ) ) { ! $ogServerName = $_SERVER['SERVER_NAME']; ! } elseif( isset( $_SERVER['HOSTNAME'] ) ) { ! $ogServerName = $_SERVER['HOSTNAME']; ! } elseif( isset( $_SERVER['HTTP_HOST'] ) ) { ! $ogServerName = $_SERVER['HTTP_HOST']; ! } elseif( isset( $_SERVER['SERVER_ADDR'] ) ) { ! $ogServerName = $_SERVER['SERVER_ADDR']; ! } else { ! $ogServerName = 'localhost'; ! } ! ! # check if server use https: ! $ogProto = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; ! ! $ogServer = $ogProto.'://' . $ogServerName; ! # If the port is a non-standard one, add it to the URL ! if( isset( $_SERVER['SERVER_PORT'] ) ! && ( ( $ogProto == 'http' && $_SERVER['SERVER_PORT'] != 80 ) ! || ( $ogProto == 'https' && $_SERVER['SERVER_PORT'] != 443 ) ) ) { ! ! $ogServer .= ":" . $_SERVER['SERVER_PORT']; ! } ! ! $ogCookiePath = '/'; ! $ogCookieDomain = ''; ! ! set_include_path( get_include_path().PATH_SEPARATOR."$configdir/".PATH_SEPARATOR."."); ! unset($configdir); ! ! require_once('functions.php'); ! if (!defined('OPENFIRST_NO_INSTALLATION')) { ! require_once('dbase.php'); ! require_once('auth.php'); ! require_once('User.php'); ! } ! if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) { ! require_once('Module.php'); ! require_once('slug.php'); ! require_once('edit.php'); ! require_once('settings.php'); ! } ! require_once('skin.php'); ! ! $sqlTablePrefix = 'ofirst_'; ! $DBaseType = dbMYSQL; ! $sqlServer = $sqlUser = $sqlPassword = false; ! $sqlDatabase = 'openfirst'; ! $pass_save_disabled = false; ! $ogPasswordSaveEnabled = true; ! $ogEncryptionType = $encryption = eCRYPT; ! ! if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) ! require_once('sitesettings.php'); ! ! $ogSQLTablePrefix = $sqlTablePrefix; ! $ogDataBaseType = $DBaseType; ! $ogSQLServer = $sqlServer; ! $ogSQLUser = $sqlUser; ! $ogSQLPassword = $sqlPassword; ! $ogSQLDatabase = $sqlDatabase; ! ! $ogPasswordSaveEnabled = !$pass_save_disabled; ! $ogEncryptionType = $encryption; ! ! if (!defined('OPENFIRST_NO_INSTALLATION')) { ! $ogDB = ofCreateDataBase($ogDataBaseType, $ogSQLServer, $ogSQLUser, $ogSQLPassword); ! $ogDB->selectDB($ogSQLDatabase, $ogSQLTablePrefix); ! } ! ! ! if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) { ! User::SetupSession(); ! /* ofDebugVar($_SESSION); ! ofDebugVar($_COOKIE);*/ ! if (User::canLogIn()) { ! $ogUser = User::logIn(); ! } else { ! $ogUser = User::loadFromSession(); ! } ! } ! ! // Determine what module the user is viewing ! if (!defined('OPENFIRST_NO_INSTALLATION')) { ! $curmodule = str_replace($BasePath, '', $_SERVER['SCRIPT_NAME']); ! $curmodule = substr($curmodule, 1, strpos($curmodule, '/', 2) - 1); ! } ! ! if (!defined('OPENFIRST_NO_INSTALLATION')) { ! // Include the functions using glob(); ! foreach (glob("$fBasePath/includes/functions/*.php") as $filename) { ! include_once($filename); ! } ! } ! ! if (!defined('OPENFIRST_NO_INSTALLATION')) { ! $headers = ''; ! ! $ogCurrentModule = new BaseModule; ! ! if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) { ! /* This is not going into a function becuase: ! 1. the files should be included in the global scope ! 2. I'd rather iterate through the array once ! */ ! $ogModuleManager = new ModuleManager; ! $res = $ogDB->query('SELECT '.$ogDB->quoteField('dir'). ! ' FROM '.$ogDB->quoteTable('config')); ! if($ogDB->errorNumber() != 0) { ! trigger_error('Error while listing modules!', E_USER_ERROR); ! } ! while($mod =& $ogDB->fetchObject($res)) { ! $dir = $mod->dir; ! $module =& $ogModuleManager->addModuleFromDir($dir); ! if ($dir == $curmodule) $ogCurrentModule =& $module; ! if ($module->getActive()) { ! $dir = $module->getDir(); ! $includes = $module->getIncludes(); ! if (is_array($includes) && count($includes) > 0) { ! foreach ($includes as $include) { ! if ($include != '') { ! include_once($include); ! } ! } ! } ! } ! } ! $ogDB->freeResult($res); ! } ! ! ! /* if (!preg_match('/\A[a-zA-Z0-9]+\z/',session_id())) { ! session_regenerate_id(); ! }*/ ! ! $ogUser->saveData(); ! /* ofDebugVar($_SESSION); ! ofDebugVar($_COOKIE);*/ ! session_write_close(); ! } ?> \ No newline at end of file --- 1,200 ---- ! <?php ! /* ! * openFIRST.base - includes/globals.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@po...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! ! // Purpose: Initialize the openFIRST system. ! ! $configdir = dirname(__FILE__); ! if( !defined('OPENFIRST_INSTALLATION_SCRIPT') && !file_exists( "$configdir/sitesettings.php" ) ) { ! $path = "#"; ! if(file_exists("../config/first.php")) { ! $path = "../config/first.php"; ! } elseif(file_exists("config/first.php")) { ! $path = "config/first.php"; ! } elseif(file_exists("../../config/first.php")) { ! $path = "../../config/first.php"; ! } ! $path = htmlentities($path); ! die( "You'll have to <a href=\"$path\">set openFIRST up</a> first!" ); ! } ! ! if (defined('OPENFIRST_NO_INSTALLATION')) { ! if(is_readable("style/headers.php")) { ! $Header = "style/headers.php"; ! } else { ! $Header = "../style/headers.php"; ! } ! } ! ! define('osUNIX', 'unix'); ! define('osWINDOWS', 'windows'); ! #Add more operating systems here ! ! if (substr(PHP_OS, 0, 3) == 'WIN') { ! $osType = osWINDOWS; ! } else { ! $osType = osUNIX; ! } ! ! #Because of the differences between versions, this may be needed. ! $usingPHP5 = version_compare(PHP_VERSION, '5.0.0', '>='); ! ! require_once('compatibility.php'); ! ! /** URL of the server. It will be automaticly build including https mode */ ! $ogServer = ''; ! ! if( isset( $_SERVER['SERVER_NAME'] ) ) { ! $ogServerName = $_SERVER['SERVER_NAME']; ! } elseif( isset( $_SERVER['HOSTNAME'] ) ) { ! $ogServerName = $_SERVER['HOSTNAME']; ! } elseif( isset( $_SERVER['HTTP_HOST'] ) ) { ! $ogServerName = $_SERVER['HTTP_HOST']; ! } elseif( isset( $_SERVER['SERVER_ADDR'] ) ) { ! $ogServerName = $_SERVER['SERVER_ADDR']; ! } else { ! $ogServerName = 'localhost'; ! } ! ! # check if server use https: ! $ogProto = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; ! ! $ogServer = $ogProto.'://' . $ogServerName; ! # If the port is a non-standard one, add it to the URL ! if( isset( $_SERVER['SERVER_PORT'] ) ! && ( ( $ogProto == 'http' && $_SERVER['SERVER_PORT'] != 80 ) ! || ( $ogProto == 'https' && $_SERVER['SERVER_PORT'] != 443 ) ) ) { ! ! $ogServer .= ":" . $_SERVER['SERVER_PORT']; ! } ! ! $ogCookiePath = '/'; ! $ogCookieDomain = ''; ! ! set_include_path( get_include_path().PATH_SEPARATOR."$configdir/".PATH_SEPARATOR."."); ! unset($configdir); ! ! require_once('functions.php'); ! if (!defined('OPENFIRST_NO_INSTALLATION')) { ! require_once('dbase.php'); ! require_once('auth.php'); ! require_once('User.php'); ! } ! if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) { ! require_once('Module.php'); ! require_once('slug.php'); ! require_once('edit.php'); ! require_once('settings.php'); ! } ! require_once('skin.php'); ! ! if (!defined('OPENFIRST_NO_INSTALLATION')) { ! $ogSQLTablePrefix = 'ofirst_'; ! $ogDataBaseType = dbMYSQL; ! $ogSQLServer = $ogSQLUser = $ogSQLPassword = false; ! $ogSQLDatabase = 'openfirst'; ! $ogPasswordSaveEnabled = true; ! $ogEncryptionType = eCRYPT; ! require_once('sitesettings.php'); ! } ! ! if (!defined('OPENFIRST_NO_INSTALLATION')) { ! $ogDB = ofCreateDataBase($ogDataBaseType, $ogSQLServer, $ogSQLUser, $ogSQLPassword); ! if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) { ! $ogDB->selectDB($ogSQLDatabase, $ogSQLTablePrefix); ! } ! } ! ! ! if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) { ! User::SetupSession(); ! /* ofDebugVar($_SESSION); ! ofDebugVar($_COOKIE);*/ ! if (User::canLogIn()) { ! $ogUser = User::logIn(); ! } else { ! $ogUser = User::loadFromSession(); ! } ! } ! ! // Determine what module the user is viewing ! if (!defined('OPENFIRST_NO_INSTALLATION')) { ! $curmodule = str_replace($BasePath, '', $_SERVER['SCRIPT_NAME']); ! $curmodule = substr($curmodule, 1, strpos($curmodule, '/', 2) - 1); ! } ! ! if (!defined('OPENFIRST_NO_INSTALLATION')) { ! // Include the functions using glob(); ! foreach (glob("$fBasePath/includes/functions/*.php") as $filename) { ! include_once($filename); ! } ! } ! ! if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) { ! $ogCurrentModule = new BaseModule; ! ! if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) { ! /* This is not going into a function becuase: ! 1. the files should be included in the global scope ! 2. I'd rather iterate through the array once ! */ ! $ogModuleManager = new ModuleManager; ! $res = $ogDB->query('SELECT '.$ogDB->quoteField('dir'). ! ' FROM '.$ogDB->quoteTable('config')); ! if($ogDB->errorNumber() != 0) { ! trigger_error('Error while listing modules!', E_USER_ERROR); ! } ! while($mod =& $ogDB->fetchObject($res)) { ! $dir = $mod->dir; ! $module =& $ogModuleManager->addModuleFromDir($dir); ! if ($dir == $curmodule) $ogCurrentModule =& $module; ! if ($module->getActive()) { ! $dir = $module->getDir(); ! $includes = $module->getIncludes(); ! if (is_array($includes) && count($includes) > 0) { ! foreach ($includes as $include) { ! if ($include != '') { ! include_once($include); ! } ! } ! } ! } ! } ! $ogDB->freeResult($res); ! } ! ! ! /* if (!preg_match('/\A[a-zA-Z0-9]+\z/',session_id())) { ! session_regenerate_id(); ! }*/ ! ! $ogUser->saveData(); ! /* ofDebugVar($_SESSION); ! ofDebugVar($_COOKIE);*/ ! session_write_close(); ! } ?> \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-10-19 04:11:51
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29687/includes Modified Files: xmlModule.php Log Message: -Added xmlModule::mUpdateDate (needs methods to go with) -xmlModule::install(), xmlModule::upgrade(), and xmlModule::uninstall() implemented. (uninstall not tested) Index: xmlModule.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/xmlModule.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** xmlModule.php 17 Oct 2005 01:18:52 -0000 1.8 --- xmlModule.php 19 Oct 2005 04:11:41 -0000 1.9 *************** *** 31,34 **** --- 31,35 ---- /*private*/ var $mIncludes, $mNavBar, $mAdminBar, $mTables; /*private*/ var $mSetupScript, $mRemoveScript, $mUpgradeScript; + /*private*/ var $mUpdateDate; // XML *************** *** 86,89 **** --- 87,92 ---- unset($this->mxmlCurRow); + $this->mUpdateDate = filemtime($File); + if (is_null($this->mMaintainer)) $this->mMaintainer = $this->mAuthor; } *************** *** 184,208 **** /*** PUBLIC FUNCTIONS ***/ /** ! * @todo Write. */ /*public*/ function install() { ! # ! return false; } /** ! * @todo Write. */ /*public*/ function upgrade() { ! # ! return false; } /** ! * @todo Write. */ /*public*/ function unintstall() { ! # ! return false; } --- 187,244 ---- /*** PUBLIC FUNCTIONS ***/ /** ! * Installs this module. */ /*public*/ function install() { ! global $ogDB; ! foreach($this->mTables as $table) { ! if (!$ogDB->updateTableFromObject($table) || ($ogDB->errorNumber() != 0)) { ! # echo $table->getName(); ! $err = $ogDB->errorString(); ! echo $err; ! return $err; ! } ! } ! if (!$this->isBase()) { ! $ogDB->replace( 'config', ! array( 'dir' => $this->getDir() ), ! array( 'modulename' => $this->getID(), ! 'dir' => $this->getDir(), ! 'UpdateDate' => $this->mUpdateDate, ! 'label' => $this->getName(), ! 'Author' => $this->getAuthor(), ! 'Maintainer' => $this->getMaintainer(), ! 'version' => $this->getVersion(), ! 'adminnavigation' => $this->getAdminBar(), ! 'modulenavigation' => $this->getNavBar(), ! 'includes' => implode(',', $this->getIncludes()) ! ) ! ); ! if ($ogDB->errorNumber() != 0) { ! return $ogDB->errorString(); ! } ! } else { ! echo "Installing base"; ! } ! return true; } /** ! * Upgrades this module. ! * Currently same as installation. */ /*public*/ function upgrade() { ! return $this->install(); } /** ! * Removes this module. */ /*public*/ function unintstall() { ! global $ogDB; ! foreach($this->mTables as $table) { ! $ogDB->dropTable($table->getName()); ! } ! $ogDB->delete('config', array( 'dir' => $this->getDir() ) ); ! return true; } |
From: Jamie <ast...@us...> - 2005-10-19 04:09:34
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29254/includes Modified Files: dbase.php Log Message: -DataBase::quoteData() now has type detection -Added DataBase::insert() -Added DataBase::createDB() -DataBase::dropKey() and DataBase::addKey() now implemented -Completed implementation of DataBase::updateTableFromObject() -Some syntax fixes, comment additions, etc. Index: dbase.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/dbase.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** dbase.php 17 Oct 2005 01:20:10 -0000 1.12 --- dbase.php 19 Oct 2005 04:09:26 -0000 1.13 *************** *** 1,594 **** ! <?php ! /* ! * openFIRST.base - includes/dbase.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@po...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by [...1218 lines suppressed...] ! $sql .= ')'; ! $this->query($sql); ! } ! ! if ($this->errorNumber() != 0) return false; // Error ! ! foreach($table->getRows() as $row) { ! $vals = array(); ! foreach($row->getValues() as $val) { ! $vals[$val] = $row->getValue($val); ! } ! // TODO: Make this multi-server compatible ! $this->query( 'REPLACE INTO '.$this->quoteTable($table->getName()). ! ' SET '.$this->quoteFDPairs($vals)); ! } ! return true; ! } ! } ?> \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-10-19 04:05:59
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28517/includes Modified Files: auth.php Log Message: -Removed setting of $encryption for default (variable no longer exists) -"referer" no longer forwarded in form TODO: Check usage of ofCryptPassword() and check usage of the $salt param Index: auth.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/auth.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** auth.php 16 Oct 2005 22:39:26 -0000 1.6 --- auth.php 19 Oct 2005 04:05:51 -0000 1.7 *************** *** 1,104 **** ! <?php ! /* ! * openFIRST.base - includes/auth.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@po...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: Deal with authorization of users. ! /** ! * @TODO Generalize sessioning & authentication and move into classes. ! */ ! ! require_once('dbase.php'); ! ! define('eCRYPT', 'crypt'); ! define('eCRC32', 'crc32'); ! define('eSHA1', 'sha1'); ! define('eMD5', 'md5'); ! ! if(isset($encryption) == false) { $encryption = eCRYPT; } ! ! // Provide functions for the various encryption types... ! // syntax: ofCryptPassword(password, encryption-type, salt); ! ! function ofCryptPassword ($password, $enctype = false, $salt="") { ! global $ogEncryptionType; ! if ($enctype === false) $enctype = $ogEncryptionType; ! ! // Encrypt passwords using whatever algorithm is preferred. ! if ($enctype == "crc32") { ! return(crc32($password)); ! } else if ($enctype == "sha1") { ! return(sha1($password)); ! } else if ($enctype == "crypt") { ! return(crypt($password, $salt)); ! } else { ! return(md5($password)); ! } ! } ! ! // Move to skin. ! function ofShowLogin ($target=false) { ! if ($target == false) $target = $_SERVER["PHP_SELF"]; ! // Show a login form for the user. ! echo("<br /><br />"); ! ! if (isset($_POST["login"]) && !isset($user)) { ! echo '<div class="error">Invalid username or password!</div>'; ! } ! ! echo "<form action='". htmlentities($target) . "' method='post'>"; ! if(isset($_SERVER["HTTP_REFERER"])){ ! echo("<input name='referer' type='hidden' value='".$_SERVER["HTTP_REFERER"]."'/>"); ! } ! echo "<table width='200' class='center' id='login'> ! <caption>Account Login</caption> ! <tr> ! <td><div align='right'><label for='login'>Username:</label></div></td> ! <td><input name='login' type='text' /> ! </td> ! </tr> ! <tr> ! <td><div align='right'><label for='password'>Password:</label></div></td> ! <td><input name='password' type='password' /></td> ! </tr> ! <tr> ! <td colspan='2'><input type=\"submit\" value=\"Login\" />"; ! global $ogPasswordSaveEnabled; ! if($ogPasswordSaveEnabled){ ! echo " <br /><input type='checkbox' name='savepass' id='savepass' value='1' checked='checked' /><label for='savepass'>Save Password</label>"; ! } ! global $BasePath; ! echo "</td></tr> ! <tr><td colspan='2'><a href=\"".htmlentities($BasePath)."/members/forgotten.php\">Forgot Password</a></td></tr> ! </table>"; // FIXME: Reference to module in base ! ! // Include anything else in the post, so it is forwarded to the actual form ! unset($_POST['login'], $_POST['password']); ! foreach($_POST as $name => $value) { ! echo '<input type="hidden" name="'.htmlentities($name).'" value="'.htmlentities($value).'" />'; ! } ! echo "</form><br /><br />"; ! } ?> \ No newline at end of file --- 1,106 ---- ! <?php ! /* ! * openFIRST.base - includes/auth.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Tim Ginn <tim...@po...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: Deal with authorization of users. ! /** ! * @TODO Generalize sessioning & authentication and move into classes. ! */ ! ! require_once('dbase.php'); ! ! define('eCRYPT', 'crypt'); ! define('eCRC32', 'crc32'); ! define('eSHA1', 'sha1'); ! define('eMD5', 'md5'); ! ! // Provide functions for the various encryption types... ! // syntax: ofCryptPassword(password, encryption-type, salt); ! ! function ofCryptPassword ($password, $enctype = false, $salt="") { ! if ($enctype === false) { ! global $ogEncryptionType; ! $enctype = $ogEncryptionType; ! } ! ! // Encrypt passwords using whatever algorithm is preferred. ! if ($enctype == "crc32") { ! return(crc32($password)); ! } else if ($enctype == "sha1") { ! return(sha1($password)); ! } else if ($enctype == "crypt") { ! return(crypt($password, $salt)); ! } else { ! return(md5($password)); ! } ! } ! ! // Move to skin. ! function ofShowLogin ($target=false) { ! if ($target == false) $target = $_SERVER["PHP_SELF"]; ! // Show a login form for the user. ! echo("<br /><br />"); ! ! global $ogUser; ! ! if (User::canLogIn() && $ogUser->isLoggedIn()) { ! echo '<div class="error">Invalid username or password!</div>'; ! } ! ! echo "<form action='". htmlentities($target) . "' method='post'>"; ! if(isset($_SERVER["HTTP_REFERER"])){ ! echo("<input name='referer' type='hidden' value='".$_SERVER["HTTP_REFERER"]."'/>"); ! } ! echo "<table width='200' class='center' id='login'> ! <caption>Account Login</caption> ! <tr> ! <td><div align='right'><label for='login'>Username:</label></div></td> ! <td><input name='login' type='text' /> ! </td> ! </tr> ! <tr> ! <td><div align='right'><label for='password'>Password:</label></div></td> ! <td><input name='password' type='password' /></td> ! </tr> ! <tr> ! <td colspan='2'><input type=\"submit\" value=\"Login\" />"; ! global $ogPasswordSaveEnabled; ! if($ogPasswordSaveEnabled){ ! echo " <br /><input type='checkbox' name='savepass' id='savepass' value='1' checked='checked' /><label for='savepass'>Save Password</label>"; ! } ! global $BasePath; ! echo "</td></tr> ! <tr><td colspan='2'><a href=\"".htmlentities($BasePath)."/members/forgotten.php\">Forgot Password</a></td></tr> ! </table>"; // FIXME: Reference to module not in base ! ! // Include anything else in the post, so it is forwarded to the actual form ! unset($_POST['login'], $_POST['password'], $_POST['referer']); ! foreach($_POST as $name => $value) { ! echo '<input type="hidden" name="'.htmlentities($name).'" value="'.htmlentities($value).'" />'; ! } ! echo "</form><br /><br />"; ! } ?> \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-10-19 04:03:56
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28200/includes Modified Files: User.php Log Message: -Changed utNONE, utNORMAL, and utADMIN to ugNONE, ugNORMAL, and ugADMIN -Removed User::mType -Added User::mReal -Added User::isRealUser() (if the user is actually a user and not a random visitor) -User::isLoggedIn() now reports if the user is the current session -Added User::createNewUser() for registration -Added a bunch of debug stuff that's all commented out (when sessions don't work, it's a real pain to fix) Index: User.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/User.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** User.php 16 Oct 2005 22:39:26 -0000 1.1 --- User.php 19 Oct 2005 04:03:48 -0000 1.2 *************** *** 1,649 **** ! <?php ! /* ! * openFIRST.base - includes/User.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Jamie Bliss <ast...@gm...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by [...1313 lines suppressed...] ! } ! } ! ! function updateLastSeen() { ! if ( !$this->isRealUser() ) return; ! global $ogDB; ! $this->mLastSeen = date("h:i:s M d, Y"); ! $ogDB->update( 'members', ! array( 'lastseen' => $this->mLastSeen ), ! array( 'user' => $this->mName ) ! ); ! // Don't set $this->mDirty because we saved the changes. ! } ! ! function &getSettingsObject($module=false) { ! return new UserSettings($module,$this); ! } ! } ?> \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-10-19 03:59:55
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27556/includes Modified Files: MySQLDataBase.php Log Message: Commented out a bunch of functions that shouldn't be overloaded (yet) Index: MySQLDataBase.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/MySQLDataBase.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MySQLDataBase.php 15 Oct 2005 19:21:01 -0000 1.2 --- MySQLDataBase.php 19 Oct 2005 03:59:48 -0000 1.3 *************** *** 133,137 **** #Used for quoting field and DB names ! function quoteName($name, $delimiter = ',') { if (is_array($name)) { $value = ''; --- 133,137 ---- #Used for quoting field and DB names ! /* function quoteName($name, $delimiter = ',') { if (is_array($name)) { $value = ''; *************** *** 144,151 **** return '`'.$this->escape($name).'`'; } ! } #Used for quoting table names. Includes table prefix. ! function quoteTable($name, $delimiter = ',') { if (is_array($name)) { $value = ''; --- 144,151 ---- return '`'.$this->escape($name).'`'; } ! }*/ #Used for quoting table names. Includes table prefix. ! /* function quoteTable($name, $delimiter = ',') { if (is_array($name)) { $value = ''; *************** *** 158,165 **** return $this->quoteName("{$this->prefix}{$name}"); } ! } #Used for quoting data ! function quoteData($data, $delimiter = ',') { if (is_array($data)) { $value = ''; --- 158,165 ---- return $this->quoteName("{$this->prefix}{$name}"); } ! }*/ #Used for quoting data ! /* function quoteData($data, $delimiter = ',') { if (is_array($data)) { $value = ''; *************** *** 172,181 **** return "'".$this->escape($data)."'"; } ! } #Used to quote field-data pairs in the form of `field`='data' #passed like: # array( 'field' => 'data' ) ! function quoteFDPairs($pairs, $delimiter = ',') { $value = ''; foreach ($pairs as $field => $data) { --- 172,181 ---- return "'".$this->escape($data)."'"; } ! }*/ #Used to quote field-data pairs in the form of `field`='data' #passed like: # array( 'field' => 'data' ) ! /* function quoteFDPairs($pairs, $delimiter = ',') { $value = ''; foreach ($pairs as $field => $data) { *************** *** 187,191 **** $value = substr($value, 0, -strlen($delimiter)); return $value; ! } /** SELECT wrapper. --- 187,191 ---- $value = substr($value, 0, -strlen($delimiter)); return $value; ! }*/ /** SELECT wrapper. *************** *** 229,233 **** * more of IGNORE, LOW_PRIORITY) */ ! function update( $table, $values, $conds, $options = array() ) { $table = $this->quoteTable( $table ); #$opts = $this->makeUpdateOptions( $options ); --- 229,233 ---- * more of IGNORE, LOW_PRIORITY) */ ! /* function update( $table, $values, $conds, $options = array() ) { $table = $this->quoteTable( $table ); #$opts = $this->makeUpdateOptions( $options ); *************** *** 238,242 **** } return $this->query( $sql ); ! } /** REPLACE query wrapper. --- 238,242 ---- } return $this->query( $sql ); ! }*/ /** REPLACE query wrapper. *************** *** 247,253 **** * @param array $values An array of values to use in a SET clause. */ ! function replace( $table, $unique, $values ) { $sql = "REPLACE INTO ".$this->quoteTable($table)." SET ".$this->quoteFDPairs($values); return $this->query( $sql ); } } --- 247,262 ---- * @param array $values An array of values to use in a SET clause. */ ! /* function replace( $table, $unique, $values ) { $sql = "REPLACE INTO ".$this->quoteTable($table)." SET ".$this->quoteFDPairs($values); return $this->query( $sql ); + }*/ + + function createDB($db, $prefix) { + $this->query('CREATE DATABASE '.$this->quoteDatabase($db)); + $erno = $this->errorNumber(); + if ($erno != 0 && $erno != 1007) return false; //1007 = Can't create DB, it already exists. + $this->selectDB($db, $prefix); + if ($this->errorNumber() != 0) return false; + return true; } } |
From: Jamie <ast...@us...> - 2005-10-19 03:58:41
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27399/includes Modified Files: Module.php Log Message: -Fixed Module::getDirs() -Added Module::setShowOnMenu() and Module::setActive() (and we need more like it) Index: Module.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/Module.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Module.php 16 Oct 2005 22:20:39 -0000 1.10 --- Module.php 19 Oct 2005 03:58:34 -0000 1.11 *************** *** 103,107 **** function getDirs() { ! return array_keys($this->modules); } } --- 103,111 ---- function getDirs() { ! if (is_array($this->modules)) { ! return array_keys($this->modules); ! } else { ! return array(); ! } } } *************** *** 204,211 **** --- 208,227 ---- } + /*public*/ function setShowOnMenu($val) { + $this->mShow = $val; + global $ogDB; + return $ogDB->update( 'config', array( 'showonmenu' => $val ), array( 'dir' => $this->mDir ) ); + } + /*public*/ function getActive() { return $this->mActive; } + /*public*/ function setActive($val) { + $this->mActive = $val; + global $ogDB; + return $ogDB->update( 'config', array( 'active' => $val ), array( 'dir' => $this->mDir ) ); + } + /* There are several functions that may optionally be implemented by a child of the Module class. |
From: Jamie <ast...@us...> - 2005-10-19 03:57:29
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27247/includes Modified Files: BaseModule.php Log Message: Changed admin bar (added title attribute) Index: BaseModule.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/BaseModule.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BaseModule.php 16 Oct 2005 22:20:39 -0000 1.1 --- BaseModule.php 19 Oct 2005 03:57:21 -0000 1.2 *************** *** 1,55 **** ! <?php ! /* ! * openFIRST.base - includes/BaseModule.php ! * ! * Copyright (C) 2005, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: Defines the BaseModule class, which extends Module for openfirst.base ! // and serves as a default for $ogCurrentModule. ! ! require_once('Module.php'); ! ! ! class BaseModule extends Module { ! function BaseModule($dir=false) { ! $this->mName = 'openFIRST'; ! $this->mID = 'openfirst.base'; ! $this->mDir = '/config'; ! $this->mVersion = 'CVS'; ! $this->mDate = time(); // Definitive date please? ! $this->mAuthor = 'The openFIRST Team'; ! $this->mMaintainer = 'The openFIRST Team'; ! ! $this->mIncludes = array(); ! $this->mNavBar = false; ! $this->mAdminBar = ofReplaceVariables('<a href="$BasePath/config/index.php">Configuration</a> | ! <a href="$BasePath/config/version.php">Version Check</a> | ! <a href="$BasePath/config/install.php">Install Module</a> | ! <a href="$BasePath/config/modules.php">Module Admin</a> | ! <a href="http://bugzilla.openfirst.org/">Report Bug</a>', $this->getDir()); ! $this->mShow = false; ! $this->mActive = true; ! } ! ! /*static*/ function createFromDir($Dir) { ! return new BaseModule($Dir); ! } ! } ?> \ No newline at end of file --- 1,55 ---- ! <?php ! /* ! * openFIRST.base - includes/BaseModule.php ! * ! * Copyright (C) 2005, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: Defines the BaseModule class, which extends Module for openfirst.base ! // and serves as a default for $ogCurrentModule. ! ! require_once('Module.php'); ! ! ! class BaseModule extends Module { ! function BaseModule($dir=false) { ! $this->mName = 'openFIRST'; ! $this->mID = 'openfirst.base'; ! $this->mDir = '/config'; ! $this->mVersion = 'CVS'; ! $this->mDate = time(); // Definitive date please? ! $this->mAuthor = 'The openFIRST Team'; ! $this->mMaintainer = 'The openFIRST Team'; ! ! $this->mIncludes = array(); ! $this->mNavBar = false; ! $this->mAdminBar = ofReplaceVariables('<a href="$BasePath/config/index.php" title="Configuration summary">Configuration</a> | ! <a href="$BasePath/config/install.php" title="Install new openFIRST modules">Install Modules</a> | ! <a href="$BasePath/config/modules.php" title="Change basic module options">Module Admin</a> | ! <a href="$BasePath/config/version.php" title="Check for updates to openFIRST and modules">Version Check</a> | ! <a href="http://bugzilla.openfirst.org/" title="Go to Bugzilla and report a problem">Report Bug</a>', $this->getDir()); ! $this->mShow = false; ! $this->mActive = true; ! } ! ! /*static*/ function createFromDir($Dir) { ! return new BaseModule($Dir); ! } ! } ?> \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-10-19 03:56:38
|
Update of /cvsroot/openfirst/base/style In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27069/style Modified Files: headers.php Log Message: More checks so that it works during installation Index: headers.php =================================================================== RCS file: /cvsroot/openfirst/base/style/headers.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** headers.php 16 Oct 2005 22:50:09 -0000 1.8 --- headers.php 19 Oct 2005 03:56:27 -0000 1.9 *************** *** 1,139 **** ! <?php ! header('content-type: text/html; charset=utf-8'); ! ! global $BasePath, $ogModuleManager, $ogMoreStyles, $Home, $ogCurrentModule; ! global $Title, $usersonline, $ogUser, $StylePath; ! ! if(! isset($BasePath)){ ! $BasePath = 'http://openfirst.sourceforge.net'; ! $title = "openFIRST Team"; ! } else { ! $headerlinks = array(); ! foreach($ogModuleManager->getDirs() as $dir) { ! $module =& $ogModuleManager->getModuleFromDir($dir); ! if ($module->getActive()) { ! if ($module->getShowOnMenu()) { ! if ($ogCurrentModule->getDir() == $dir){ ! $CurrentModule =& $thisModule; ! $headerlinks[] = ' » <a class="menu selected" href="'.htmlentities("$BasePath/$dir").'">'.htmlentities($module->getName()).'</a> ! '; ! $adminnav = $module->getAdminBar(); ! $subnav = $module->getNavBar(); ! ! } else { ! $headerlinks[] .= ' » <a class="menu" href="'.htmlentities("$BasePath/$dir").'">'.htmlentities($module->getName()).'</a> ! '; ! } ! } ! } ! } ! ! $headers = implode(' |', $headerlinks); ! unset($headerlinks); ! } ! ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ! <html> ! <head> ! <title><?php echo htmlentities($Title); ?></title> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> ! <meta http-equiv="Content-Language" content="en" /> ! <meta name="copyright" content="© 2003 openFIRST http://openfirst.sf.net." /> ! <meta name="author" content="openFIRST - http://openfirst.sf.net" /> ! <meta name="generator" content="openFIRST - http://openfirst.sf.net" /> ! <link rel="stylesheet" type="text/css" href="<?php echo htmlentities($StylePath); ?>/style.css" /> ! <?php ! if (isset($ogMoreStyles) && trim($ogMoreStyles) != '') { ! echo '<style type="text/css"> ! '.htmlentities($ogMoreStyles).' ! </style> ! '; ! } ! ?> ! </head> ! <body> ! ! <table class="nav1"> ! <tr id="toplogo"> ! <td> ! <img src="<?php echo htmlentities($BasePath); ?>/style/images/openfirst.png" alt="openFIRST Portal System" /> ! </td> ! </tr> ! <tr> ! <th id="topmenu"> ! <?php ! if(isset($headers)){ ! echo("» <a accesskey='h' href='$Home'><u>H</u>ome</a> | " . $headers); ! }else{ ! ?> ! » <a accesskey="h" href="http://openfirst.sourceforge.net"><u>H</u>ome</a> ! | » <a accesskey="d" href="http://openfirst.sourceforge.net/downloads.php"><u>D</u>ownloads</a> ! | » <a accesskey="r" href="http://openfirst.sourceforge.net/release.php"><u>R</u>elease Notes</a> ! | » <a accesskey="m" href="http://openfirst.sourceforge.net/modules.php"><u>M</u>odules</a> ! | » <a accesskey="l" href="http://openfirst.sourceforge.net/license.php"><u>L</u>icense</a> ! | » <a accesskey="b" href="http://openfirst.sourceforge.net/bugreports.php"><u>B</u>ug Reports</a> ! | » <a accesskey="c" href="http://openfirst.sourceforge.net/contact.php"><u>C</u>ontact Us</a> ! | » <a accesskey="a" href="http://openfirst.sourceforge.net/about.php"><u>A</u>bout openFIRST</a> ! | » <a accesskey="e" href="http://openfirst.sourceforge.net/developers.php">D<u>e</u>velopers</a> ! <?php } ?> ! </th> ! </tr> ! <tr> ! <td class="nav2" style="background-image: url('<?php echo htmlentities($StylePath); ?>/images/back-light.gif'); "> ! <table width="100%" border="0" cellspacing="0" ! cellpadding="0"> ! <tr> ! <td class="left"> ! <?php ! ! // Check if module name has been set then echo ! if(isset($ogCurrentModule) && !$ogCurrentModule->isBase()){ ! echo '<b>'.htmlentities($ogCurrentModule->getName()).'</b> – '; ! } ! ! // Check if navigation bar option is set then echo options ! if ($nav = $ogCurrentModule->getNavBar()) { ! ! // Output module navigation bar ! echo $nav; ! } ! ?> ! </td> ! <td class="right" style="color: #333333;"> ! <?php ! ! // Check if messenger module has activated usersonline option then echo value ! if(isset($usersonline)){ ! echo $usersonline; ! } else { ! echo "Welcome to the <b>$Title</b> website!"; ! } ! ! ?> ! </td> ! </tr> ! </table></td> ! </tr> ! <?php ! ! if ($ogUser->isAdmin() && ($nav = $ogCurrentModule->getAdminBar())){ ! ?> ! <tr> ! <td id="adminmenu"><b>Admin Options</b> – ! <?php ! // Print admin navigation bar ! echo $nav; ! ?></td> ! </tr> ! <?php ! ! } ! ! ?> ! </table><div id="content"> ! <?php ! ! if ($BasePath == 'http://openfirst.sourceforge.net') { ! unset($BasePath); ! } ! ! ?> --- 1,140 ---- ! <?php ! header('content-type: text/html; charset=utf-8'); ! ! global $BasePath, $ogModuleManager, $ogMoreStyles, $Home, $ogCurrentModule; ! global $Title, $usersonline, $ogUser, $StylePath; ! ! if(! isset($BasePath)){ ! $BasePath = 'http://openfirst.sourceforge.net'; ! $StylePath = 'http://openfirst.sourceforge.net'; ! $title = "openFIRST Team"; ! } else { ! $headerlinks = array(); ! if (isset($ogModuleManager)) { ! foreach($ogModuleManager->getDirs() as $dir) { ! $module =& $ogModuleManager->getModuleFromDir($dir); ! if ($module->getActive() && $module->getShowOnMenu()) { ! if ($ogCurrentModule->getDir() == $dir){ ! $CurrentModule =& $thisModule; ! $headerlinks[] = ' » <a class="menu selected" href="'.htmlentities("$BasePath/$dir").'">'.htmlentities($module->getName()).'</a> ! '; ! $adminnav = $module->getAdminBar(); ! $subnav = $module->getNavBar(); ! ! } else { ! $headerlinks[] .= ' » <a class="menu" href="'.htmlentities("$BasePath/$dir").'">'.htmlentities($module->getName()).'</a> ! '; ! } ! } ! } ! } ! ! $headers = implode(' |', $headerlinks); ! unset($headerlinks); ! } ! ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ! <html> ! <head> ! <title><?php echo htmlentities($Title); ?></title> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> ! <meta http-equiv="Content-Language" content="en" /> ! <meta name="copyright" content="© 2003 openFIRST http://openfirst.sf.net." /> ! <meta name="author" content="openFIRST - http://openfirst.sf.net" /> ! <meta name="generator" content="openFIRST - http://openfirst.sf.net" /> ! <link rel="stylesheet" type="text/css" href="<?php echo htmlentities($StylePath); ?>/style.css" /> ! <?php ! if (isset($ogMoreStyles) && trim($ogMoreStyles) != '') { ! echo '<style type="text/css"> ! '.htmlentities($ogMoreStyles).' ! </style> ! '; ! } ! ?> ! </head> ! <body> ! ! <table class="nav1"> ! <tr id="toplogo"> ! <td> ! <img src="<?php echo htmlentities($StylePath); ?>/images/openfirst.png" alt="openFIRST Portal System" /> ! </td> ! </tr> ! <tr> ! <th id="topmenu"> ! <?php ! if(isset($headers)){ ! echo("» <a accesskey='h' href='$Home'><u>H</u>ome</a> | " . $headers); ! }else{ ! ?> ! » <a accesskey="h" href="http://openfirst.sourceforge.net"><u>H</u>ome</a> ! | » <a accesskey="d" href="http://openfirst.sourceforge.net/downloads.php"><u>D</u>ownloads</a> ! | » <a accesskey="r" href="http://openfirst.sourceforge.net/release.php"><u>R</u>elease Notes</a> ! | » <a accesskey="m" href="http://openfirst.sourceforge.net/modules.php"><u>M</u>odules</a> ! | » <a accesskey="l" href="http://openfirst.sourceforge.net/license.php"><u>L</u>icense</a> ! | » <a accesskey="b" href="http://openfirst.sourceforge.net/bugreports.php"><u>B</u>ug Reports</a> ! | » <a accesskey="c" href="http://openfirst.sourceforge.net/contact.php"><u>C</u>ontact Us</a> ! | » <a accesskey="a" href="http://openfirst.sourceforge.net/about.php"><u>A</u>bout openFIRST</a> ! | » <a accesskey="e" href="http://openfirst.sourceforge.net/developers.php">D<u>e</u>velopers</a> ! <?php } ?> ! </th> ! </tr> ! <tr> ! <td class="nav2" style="background-image: url('<?php echo htmlentities($StylePath); ?>/images/back-light.gif'); "> ! <table width="100%" border="0" cellspacing="0" ! cellpadding="0"> ! <tr> ! <td class="left"> ! <?php ! ! // Check if module name has been set then echo ! if(isset($ogCurrentModule) && !$ogCurrentModule->isBase()){ ! echo '<b>'.htmlentities($ogCurrentModule->getName()).'</b> – '; ! } ! ! // Check if navigation bar option is set then echo options ! if (isset($ogCurrentModule) && ($nav = $ogCurrentModule->getNavBar())) { ! ! // Output module navigation bar ! echo $nav; ! } ! ?> ! </td> ! <td class="right" style="color: #333333;"> ! <?php ! ! // Check if messenger module has activated usersonline option then echo value ! if(isset($usersonline)){ ! echo $usersonline; ! } else { ! echo "Welcome to the <b>$Title</b> website!"; ! } ! ! ?> ! </td> ! </tr> ! </table></td> ! </tr> ! <?php ! ! if (isset($ogUser) && isset($ogCurrentModule) && $ogUser->isAdmin() && ($nav = $ogCurrentModule->getAdminBar())){ ! ?> ! <tr> ! <td id="adminmenu"><b>Admin Options</b> – ! <?php ! // Print admin navigation bar ! echo $nav; ! ?></td> ! </tr> ! <?php ! ! } ! ! ?> ! </table><div id="content"> ! <?php ! ! if ($BasePath == 'http://openfirst.sourceforge.net') { ! unset($BasePath); ! } ! ! ?> |
From: Jamie <ast...@us...> - 2005-10-19 03:55:29
|
Update of /cvsroot/openfirst/base/style In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26864/style Modified Files: style.css Log Message: Added big class. Index: style.css =================================================================== RCS file: /cvsroot/openfirst/base/style/style.css,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** style.css 12 Sep 2005 01:40:09 -0000 1.6 --- style.css 19 Oct 2005 03:55:20 -0000 1.7 *************** *** 1,317 **** ! /* Basic elements */ ! bold { ! font-weight: bold; ! } ! ! big { ! font-size: large; ! } ! ! input[type=text], select { ! text-align: left; ! } ! ! input[type=checkbox], input[type=radio] { ! margin-right: .3em; ! vertical-align: middle; ! } ! ! caption { ! text-align: center; ! font-size: medium; ! padding: .25em; ! font-weight: bold; ! } ! ! pre, code, tt { ! font-weight: normal; ! } ! ! pre { ! text-align: left; ! } ! ! /* classes and IDs */ ! #content { ! padding: 1em; ! text-align: center; ! margin-left: auto; ! margin-right: auto; ! } ! #content table { ! margin-left: auto; ! margin-right: auto; ! text-align: center; ! } ! ! #adminmenu { ! color: white; ! background-image: url(images/back-admin.png); ! text-align: left; ! } ! #adminmenu a:link { ! color: white; ! } ! #adminmenu a:visited { ! color: white; ! } ! #adminmenu a:active { ! color: white; ! } ! #adminmenu a:hover { ! color: white; ! } ! ! a:link { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline; ! } ! a:visited { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline; ! } ! a:active { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline; ! } ! a:hover { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline; ! } ! ! #topmenu, caption { ! text-align: left; ! background-image: url(images/back.gif); ! color: #cecece; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:link { ! color: #cecece; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:visited { ! color: #bebebe; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:active { ! color: #cecece; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:hover { ! color: #bed8ff; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! ! #toplogo { ! text-align: left; ! } ! ! .nav1 { ! width:100%; ! border: none 0px; ! margin-left: -2px; ! margin-right: -2px; ! margin-bottom: 0; ! } ! .nav1 td, .nav1 th { ! margin: 0; ! padding: 6px; ! border: none 0px; ! } ! .nav1 tr { ! margin: 0px; ! padding: 2px; ! } ! ! .nav2 table { ! border-left:solid #999999 1px; ! border-right:solid #999999 1px; ! border-bottom:solid #999999 1px; ! margin-left:auto; ! margin-right:auto; ! } ! ! .center, .center > * { ! margin-left: auto; ! margin-right: auto; ! text-align: center; ! } ! ! .right, .right > * { ! margin-left: auto; ! margin-right: 0; ! text-align: right; ! } ! ! .left, .left > * { ! margin-left: 0; ! margin-right: auto; ! text-align: left; ! } ! ! .contentleft, .contentleft > * { ! margin-left: auto; ! margin-right: auto; ! text-align: left; ! } ! ! .file { ! font-family: monospace; ! } ! ! td { ! padding: 5px; ! } ! th { ! padding: 5px; ! } ! table.menu { ! border-left:0px; ! border-right:0px; ! border-bottom:0px; ! } ! td.menu { ! border-left:0px; ! border-right:0px; ! border-bottom:0px; ! } ! body { ! color: black; ! font-weight: bolder; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration:none; ! margin: 0px; ! padding: 2px; ! text-align: center; ! } ! td { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! td.navigation { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! th { ! background-color: #999999; ! color: #333333; ! background-image: url(images/back-light.gif); ! } ! ! td.sub { ! background-color: #999999; ! color: #333333; ! background-image: url(images/back-lighter.gif); ! } ! ! .menu.selected { ! color: red; ! text-decoration: underline; ! } ! ! .small { ! font-size:small; ! } ! ! fieldset { ! margin: 1em 1.5em; ! } ! ! LEGEND { ! font-size: 1.5em; ! font-weight: bold; ! } ! ! dl.setup { ! text-align: left; ! } ! dl.setup dd { ! margin-left: 0; ! } ! dl.setup dd label { ! clear: left; ! font-weight: bold; ! width: 12em; ! float: left; ! text-align: right; ! padding-right: 1em; ! } ! dl.setup dt { ! clear: left; ! font-size: 0.8em; ! margin-left: 10em; ! /* margin-right: 200px; */ ! margin-bottom: 2em; ! } ! .error, .warning { ! color: red; ! } ! ul.plain { ! list-style: none; ! clear: both; ! margin-left: 12em; ! } ! dl.setup input:not([type=checkbox]) { ! width: 25em; ! } ! ! table.center caption { ! margin-left:auto; ! margin-right:auto; ! } ! ! hr { ! width: 80%; ! border: 1px; ! height: 1px; ! } ! ! #copyright { ! background=image: url(images/back-light.gif); ! } ! ! #footer p { ! margin: 0; ! } ! ! .logo, .logo img, ! .valid, .valid img { ! border: 0; ! } ! ! #moduleInstall * { ! text-align: left; ! } ! ! .no-space, ! table.no-space tr, table.no-space td, table.no-space th { ! margin: 0; ! padding: 0; ! } ! ! margin: 0; ! padding: 0; ! } --- 1,317 ---- ! /* Basic elements */ ! bold { ! font-weight: bold; ! } ! ! big { ! font-size: large; ! } ! ! input[type=text], select { ! text-align: left; ! } ! ! input[type=checkbox], input[type=radio] { ! margin-right: .3em; ! vertical-align: middle; ! } ! ! caption { ! text-align: center; ! font-size: medium; ! padding: .25em; ! font-weight: bold; ! } ! ! pre, code, tt { ! font-weight: normal; ! } ! ! pre { ! text-align: left; ! } ! ! /* classes and IDs */ ! #content { ! padding: 1em; ! text-align: center; ! margin-left: auto; ! margin-right: auto; ! } ! #content table { ! margin-left: auto; ! margin-right: auto; ! text-align: center; ! } ! ! #adminmenu { ! color: white; ! background-image: url(images/back-admin.png); ! text-align: left; ! } ! #adminmenu a:link { ! color: white; ! } ! #adminmenu a:visited { ! color: white; ! } ! #adminmenu a:active { ! color: white; ! } ! #adminmenu a:hover { ! color: white; ! } ! ! a { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline; ! } ! a:visited { ! /* color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline;*/ ! } ! a:active { ! /* color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline;*/ ! } ! a:hover { ! /* color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: underline;*/ ! } ! ! #topmenu, caption { ! text-align: left; ! background-image: url(images/back.gif); ! color: #cecece; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:link { ! color: #cecece; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:visited { ! color: #bebebe; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:active { ! color: #cecece; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! #topmenu a:hover { ! color: #bed8ff; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! ! #toplogo { ! text-align: left; ! } ! ! .nav1 { ! width:100%; ! border: none 0px; ! margin-left: -2px; ! margin-right: -2px; ! margin-bottom: 0; ! } ! .nav1 td, .nav1 th { ! margin: 0; ! padding: 6px; ! border: none 0px; ! } ! .nav1 tr { ! margin: 0px; ! padding: 2px; ! } ! ! .nav2 table { ! border-left:solid #999999 1px; ! border-right:solid #999999 1px; ! border-bottom:solid #999999 1px; ! margin-left:auto; ! margin-right:auto; ! } ! ! .center, .center > * { ! margin-left: auto; ! margin-right: auto; ! text-align: center; ! } ! ! .right, .right > * { ! margin-left: auto; ! margin-right: 0; ! text-align: right; ! } ! ! .left, .left > * { ! margin-left: 0; ! margin-right: auto; ! text-align: left; ! } ! ! .contentleft, .contentleft > * { ! margin-left: auto; ! margin-right: auto; ! text-align: left; ! } ! ! .file { ! font-family: monospace; ! } ! ! td { ! padding: 5px; ! } ! th { ! padding: 5px; ! } ! table.menu { ! border-left:0px; ! border-right:0px; ! border-bottom:0px; ! } ! td.menu { ! border-left:0px; ! border-right:0px; ! border-bottom:0px; ! } ! body { ! color: black; ! font-weight: bolder; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration:none; ! margin: 0px; ! padding: 2px; ! text-align: center; ! } ! td { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! td.navigation { ! color: black; ! font-size: 12px; ! font-family: sans-serif; ! text-decoration: none; ! } ! th { ! background-color: #999999; ! color: #333333; ! background-image: url(images/back-light.gif); ! } ! ! td.sub { ! background-color: #999999; ! color: #333333; ! background-image: url(images/back-lighter.gif); ! } ! ! .menu.selected { ! color: red; ! text-decoration: underline; ! } ! ! .small { ! font-size: small; ! } ! ! fieldset { ! margin: 1em 1.5em; ! } ! ! LEGEND { ! font-size: 1.5em; ! font-weight: bold; ! } ! ! dl.setup { ! text-align: left; ! } ! dl.setup dd { ! margin-left: 0; ! } ! dl.setup dd label { ! clear: left; ! font-weight: bold; ! width: 12em; ! float: left; ! text-align: right; ! padding-right: 1em; ! } ! dl.setup dt { ! clear: left; ! font-size: 0.8em; ! margin-left: 10em; ! /* margin-right: 200px; */ ! margin-bottom: 2em; ! } ! .error, .warning { ! color: red; ! } ! ul.plain { ! list-style: none; ! clear: both; ! margin-left: 12em; ! } ! dl.setup input:not([type=checkbox]) { ! width: 25em; ! } ! ! table.center caption { ! margin-left:auto; ! margin-right:auto; ! } ! ! hr { ! width: 80%; ! border: 1px; ! height: 1px; ! } ! ! #copyright { ! /* background-image: url(images/back-light.gif);*/ ! } ! ! #footer p { ! margin: 0; ! } ! ! .logo, .logo img, ! .valid, .valid img { ! border: 0; ! } ! ! #moduleInstall * { ! text-align: left; ! } ! ! .no-space, ! table.no-space tr, table.no-space td, table.no-space th { ! margin: 0; ! padding: 0; ! } ! ! .big, .big * { ! font-size: large; ! } \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-10-17 01:20:20
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8154/includes Modified Files: dbase.php Log Message: Added a whole bunch of structure manipulation methods, many aren't fully implemented. Back-end SQL based on MySQL. Index: dbase.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/dbase.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** dbase.php 16 Oct 2005 22:22:49 -0000 1.11 --- dbase.php 17 Oct 2005 01:20:10 -0000 1.12 *************** *** 353,356 **** --- 353,594 ---- return $this->query( $sql ); } + + /** + * These functions manipulate the structure of the table. + * They are used primarily by the module manager. + */ + + /** + * DROP TABLE query wrapper. + * Deletes a table, include structure and content. + */ + function dropTable($table) { + return $this->query('DROP TABLE '.$this->quoteTable($table); + } + + /** + * TRUNCATE TABLE query wrapper. + * Removes all data from a table. + */ + function truncateTable($table) { + return $this->query('TRUNCATE TABLE '.$this->quoteTable($table)); + } + + /** + * Returns true if a table exists. + */ + function tableExists($table) { + $r = $this->query('SELECT 1 FROM '.$this->quoteTable($table)); + if ($this->errorNumber() == 0) { + $val = true; + } else { + $val = false; + } + $this->freeResult($r); + return $val; + } + + /** + * Returns true if a column exists in the table. + */ + function columnExists($table, $col) { + $r = $this->query('SHOW COLUMNS FROM '.$this->quoteTable($table)); + $val = false; + if ($this->errorNumber() == 0) { + while($row = $this->fetchObject($r)) { + if ($col == $row->Field) { + $val = true; + break; + } + } + $this->freeResult($r); + } + return $val; + } + + function getColumns($table) { + $r = $this->query('SHOW COLUMNS FROM '.$this->quoteTable($table)); + $val = array(); + if ($this->errorNumber() == 0) { + while($row = $this->fetchObject($r)) { + $val[] = $row->Field; + } + $this->freeResult($r); + } + return $val; + } + + function dropColumn($table, $col) { + $this->query('ALTER TABLE '.$this->quoteTable($table).' DROP COLUMN '.$this->quoteField($col)); + } + + // These should have a higher level of abstraction + function alterColumn($table, $oldcol, $spec) { + $this->query('ALTER TABLE '.$this->quoteTable($table).' CHANGE COLUMN '.$this->quoteField($col).' '.$this->quoteField($col).' '.$spec); + } + + function addColumn($table, $col, $spec) { + $this->query('ALTER TABLE '.$this->quoteTable($table).' ADD COLUMN '.$this->quoteField($col).' '.$spec); + } + + /** + * Returns true if a key exists in the table. + */ + function keyExists($table, $key) { + $r = $this->query('SHOW INDEX FROM '.$this->quoteTable($table)); + $val = false; + if ($this->errorNumber() == 0) { + while($row = $this->fetchObject($r)) { + if ($key == $row->Key_name) { + $val = true; + break; + } + } + $this->freeResult($r); + } + return $val; + } + + function getKeys($table) { + $r = $this->query('SHOW INDEX FROM '.$this->quoteTable($table)); + $val = array(); + if ($this->errorNumber() == 0) { + while($row = $this->fetchObject($r)) { + $val[$row->Key_name] = true; + } + $this->freeResult($r); + } + return array_keys($val); + } + + function dropKey($table, $key) { + # + } + + function alterKey($table, $key, $spec) { + // Can't change keys? + $this->dropKey($table, $key); + $this->addKey($table, $key, $spec); + } + + function addKey($table, $key, $spec) { + # + } + + /** + * Takes a xmlTable object (from xmlModule.php) and applies it to the + * database. It works by assembling one big statement for structure, running + * it, and then doing a bunch of calls to replace() for the data. + */ + function updateTableFromObject($table) { + $sql = ''; + $cols = $keys = array(); // array of column/key defs + + foreach($table->getCols() as $colname) { + $col = $table->getCol($colname); + #$scol = $this->quoteField($col->getName()); + $scol = ''; + $type = $col->getType(); + if ($type == 'SET' || $type == 'ENUM') { + $type .= '('.$this->quoteData($col->getValues()).')'; + } else if ($col->hasLength()) { + $type .= '('.$col->getLength().')'; + } + if ($col->hasUnsigned() && $col->getUnsigned()) { + $type .= ' UNSIGNED'; + } + if ($col->hasZerofill() && $col->getZerofill()) { + $type .= ' ZEROFILL'; + } + $scol .= ' '.$type; + if ($col->hasNull()) { + $scol .= $col->getNull() ? ' NULL' : ' NOT NULL'; + } + if ($col->hasDefault()) { + $scol .= ' DEFAULT '.$this->quoteData($col->getDefault()); + } + if ($col->hasAutoIncrement() && $col->getAutoIncrement()) { + $scol .= ' AUTO_INCREMENT'; + } + $cols[$colname] = $scol; + } + + foreach($table->getKeys() as $keyname) { + $key = $table->getKey($keyname); + $skey = ''; + $primary + if ($key->getType() == 'PRIMARY') { + $skey = 'PRIMARY KEY'; + } else if ($key->getType() == 'UNIQUE') { + $skey = 'UNIQUE '.$this->quoteField($key->getName()); + } else { + $skey = 'KEY '.$this->quoteField($key->getName()); + } + $skey .= ' ('; + $keycols = array(); + foreach($key->getCols() as $col) { + $scol = $this->quoteField($col); + if ($key->hasColLength($col)) { + $scol .= '('.$key->getColLength($col).')'; + } + // ASC/DESC would go here + $keycols[] = $scol; + } + $skey .= implode(',', $keycols); + $skey .= ')'; + + $keys[] = $skey; + } + + $sql = ''; + if ($this->tableExists($table->getName())) { + $tname = $table->getName(); + // Do an ALTER TABLE + $sql = 'ALTER TABLE '.$this->quoteTable($table->getName()); + // Go through and figure out what needs to be done in each column and key + // A list of the columns/keys currently in the table + $oldcols = $this->getColumns($tname); + $oldkeys = $this->getKeys($tname); + // A list of which columns/keys need to be removed + $delcols = array_diff($oldcols, array_keys($cols)); + $delkeys = array_diff($oldkeys, array_keys($keys)); + // A list of which columns/keys need to be added + $addcols = array_diff(array_keys($cols), $oldcols); + $addkeys = array_diff(array_keys($keys), $oldkeys); + // A list of which columns/keys are just changed + $changedcols = array_intersect(array_keys($cols), $oldcols); + $changedkeys = array_intersect(array_keys($keys), $oldkeys); + + // Now execute a bunch of statements to do this. + /* In this order: + - Delete keys to free columns + - Delete columns + - modify columns + - add columns + - modify keys since all columns are now there + - add keys since all columns are now there + */ + } else { + // Do a CREATE TABLE + $sql = 'CREATE TABLE '.$this->quoteTable($table->getName()); + $sql .= ' ('; + $sql .= implode(",\n", $cols + $keys); + $sql .= ')'; + } + $this->query($sql); + + if ($this->errorNumber() != 0) return false; // Error + + foreach($table->getRows() as $row) { + $vals = array(); + foreach($row->getValues as $val) { + $vals[$val] = $row->getValue($val); + } + // TODO: Make this multi-server compatible + $this->query( 'REPLACE INTO '.$this->quoteTable($table->getName()). + ' SET '.$this->quoteFDPairs($vals)); + } + return true; + } } ?> \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-10-17 01:19:00
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7734/includes Modified Files: xmlModule.php Log Message: the name of the PRIMARY key is upercase PRIMARY Index: xmlModule.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/xmlModule.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** xmlModule.php 16 Oct 2005 22:20:39 -0000 1.7 --- xmlModule.php 17 Oct 2005 01:18:52 -0000 1.8 *************** *** 619,623 **** if ( (strcasecmp($this->mType, 'primary') == 0) || (strcasecmp($this->mName, 'primary') == 0) ) { ! $this->mType = 'primary'; $this->mName = 'PRIMARY'; } --- 619,623 ---- if ( (strcasecmp($this->mType, 'primary') == 0) || (strcasecmp($this->mName, 'primary') == 0) ) { ! $this->mType = 'PRIMARY'; $this->mName = 'PRIMARY'; } *************** *** 638,642 **** if ( $this->mType == 'PRIMARY' ) { ! $this->mType = 'primary'; $this->mName = 'PRIMARY'; } --- 638,642 ---- if ( $this->mType == 'PRIMARY' ) { ! $this->mType = 'PRIMARY'; $this->mName = 'PRIMARY'; } |
From: Jamie <ast...@us...> - 2005-10-17 01:18:14
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7597/includes Modified Files: slug.php Log Message: Changed behavior such that it assumes the slug is the URL path if it isn't parsable, instead of returning false. Index: slug.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/slug.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** slug.php 29 Jun 2005 21:33:47 -0000 1.1 --- slug.php 17 Oct 2005 01:18:05 -0000 1.2 *************** *** 1,53 **** ! <?php ! /* ! * openFIRST.base - includes/slug.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: Defines the functions to handle slugs. ! ! /** Returns the URI of a slug. ! * Note that it is relative to $BasePath, so you still need to ! * prepend $BasePath to it. ! * It also removes an initial slug: in it. ! */ ! function ofGetSlugURI($slug) { ! global $ogModuleManager; ! if (strcasecmp(substr($slug, 1, strlen('slug:')), 'slug:') == 0) { ! $slug = substr($slug, strlen('slug:')); ! } ! $parts = explode('/', $slug); ! if (!isset($parts[1])) { ! return '/'.$parts[0]; ! } else if ($parts[1] == '') { ! return '/'.$parts[0].'/'; ! } else { ! $dir = $parts[0]; ! $modslug = $parts[1]; ! $module =& $ogModuleManager->getModuleFromDir($dir); ! if (method_exists($module, 'getSlugURI')) { ! return $module->getSlugURI($modslug); ! } else { ! return false; ! } ! } ! } ! ! ?> --- 1,53 ---- ! <?php ! /* ! * openFIRST.base - includes/slug.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! // Purpose: Defines the functions to handle slugs. ! ! /** Returns the URI of a slug. ! * Note that it is relative to $BasePath, so you still need to ! * prepend $BasePath to it. ! * It also removes an initial slug: in it. ! */ ! function ofGetSlugURI($slug) { ! global $ogModuleManager; ! if (strcasecmp(substr($slug, 1, strlen('slug:')), 'slug:') == 0) { ! $slug = substr($slug, strlen('slug:')); ! } ! $parts = explode('/', $slug); ! if (!isset($parts[1])) { ! return '/'.$parts[0]; ! } else if ($parts[1] == '') { ! return '/'.$parts[0].'/'; ! } else { ! $dir = $parts[0]; ! $modslug = $parts[1]; ! $module =& $ogModuleManager->getModuleFromDir($dir); ! if (method_exists($module, 'getSlugURI')) { ! return $module->getSlugURI($modslug); ! } else { ! return '/'.$slug; ! } ! } ! } ! ! ?> |
From: Jamie <ast...@us...> - 2005-10-16 22:50:17
|
Update of /cvsroot/openfirst/base/style In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11798/style Modified Files: headers.php Log Message: Kinda updated for modules, includes a bunch of globals (so it can be included in a function) Index: headers.php =================================================================== RCS file: /cvsroot/openfirst/base/style/headers.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** headers.php 12 Sep 2005 01:39:25 -0000 1.7 --- headers.php 16 Oct 2005 22:50:09 -0000 1.8 *************** *** 2,5 **** --- 2,8 ---- header('content-type: text/html; charset=utf-8'); + global $BasePath, $ogModuleManager, $ogMoreStyles, $Home, $ogCurrentModule; + global $Title, $usersonline, $ogUser, $StylePath; + if(! isset($BasePath)){ $BasePath = 'http://openfirst.sourceforge.net'; *************** *** 11,15 **** if ($module->getActive()) { if ($module->getShowOnMenu()) { ! if ($curmodule == $dir){ $CurrentModule =& $thisModule; $headerlinks[] = ' » <a class="menu selected" href="'.htmlentities("$BasePath/$dir").'">'.htmlentities($module->getName()).'</a> --- 14,18 ---- if ($module->getActive()) { if ($module->getShowOnMenu()) { ! if ($ogCurrentModule->getDir() == $dir){ $CurrentModule =& $thisModule; $headerlinks[] = ' » <a class="menu selected" href="'.htmlentities("$BasePath/$dir").'">'.htmlentities($module->getName()).'</a> *************** *** 59,63 **** <th id="topmenu"> <?php ! if(ISSET($headers)){ echo("» <a accesskey='h' href='$Home'><u>H</u>ome</a> | " . $headers); }else{ --- 62,66 ---- <th id="topmenu"> <?php ! if(isset($headers)){ echo("» <a accesskey='h' href='$Home'><u>H</u>ome</a> | " . $headers); }else{ *************** *** 84,96 **** // Check if module name has been set then echo ! if(isset($CurrentModule)){ ! echo '<b>'.htmlentities($CurrentModule->getName()).'</b> – '; } // Check if navigation bar option is set then echo options ! if(isset($subnav)){ // Output module navigation bar ! echo $subnav; } ?> --- 87,99 ---- // Check if module name has been set then echo ! if(isset($ogCurrentModule) && !$ogCurrentModule->isBase()){ ! echo '<b>'.htmlentities($ogCurrentModule->getName()).'</b> – '; } // Check if navigation bar option is set then echo options ! if ($nav = $ogCurrentModule->getNavBar()) { // Output module navigation bar ! echo $nav; } ?> *************** *** 113,119 **** <?php ! if (isset($user) && isset($user->user)){ ! if(isset($adminnav) && (strcasecmp($user->membertype, 'administrator') == 0)) { ! ?> <tr> --- 116,120 ---- <?php ! if ($ogUser->isAdmin() && ($nav = $ogCurrentModule->getAdminBar())){ ?> <tr> *************** *** 121,130 **** <?php // Print admin navigation bar ! echo $adminnav; ?></td> </tr> <?php - } } --- 122,130 ---- <?php // Print admin navigation bar ! echo $nav; ?></td> </tr> <?php } |
From: Jamie <ast...@us...> - 2005-10-16 22:49:10
|
Update of /cvsroot/openfirst/base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11601 Modified Files: index.php Log Message: Show of login prompt based on $ogUser Index: index.php =================================================================== RCS file: /cvsroot/openfirst/base/index.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** index.php 15 Oct 2005 19:39:15 -0000 1.19 --- index.php 16 Oct 2005 22:49:02 -0000 1.20 *************** *** 39,43 **** <tr> <?php ! if(isset($Headers) == false) { echo("You may: <a href='config/'>login to configure openFIRST options</a>."); } --- 39,43 ---- <tr> <?php ! if(!$ogUser->isLoggedIn()) { echo("You may: <a href='config/'>login to configure openFIRST options</a>."); } |