openfirst-cvscommit Mailing List for openFIRST (Page 11)
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-09-11 14:20:06
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3795/includes Modified Files: xmlModule.php Log Message: XML parser finally finished! Index: xmlModule.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/xmlModule.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** xmlModule.php 23 Aug 2005 18:15:46 -0000 1.4 --- xmlModule.php 11 Sep 2005 14:19:57 -0000 1.5 *************** *** 37,41 **** # /*private*/ var $mIncludesTag, $mDBTag; // States ! /*private*/ var $mxmlCurTable, $mxmlCurField, $mxmlCurKey; function xmlModule($File) { --- 37,41 ---- # /*private*/ var $mIncludesTag, $mDBTag; // States ! /*private*/ var $mxmlCurTable, $mxmlCurField, $mxmlCurKey, $mxmlCurRow; function xmlModule($File) { *************** *** 51,54 **** --- 51,55 ---- $this->mxmlCurField = false; $this->mxmlCurKey = false; + $this->mxmlCurRow = false; $hXML = xml_parser_create(); *************** *** 83,86 **** --- 84,88 ---- unset($this->mRootElement); unset($this->mTagStack); + unset($this->mxmlCurRow); if (is_null($this->mMaintainer)) $this->mMaintainer = $this->mAuthor; *************** *** 162,287 **** /*** PUBLIC FUNCTIONS ***/ - /** Parse the <db> tag - */ - /*public*/ function prepareTables() { - $this->mTables = array(); - - foreach($this->mDBTag->Contents as $table) { - if (!( is_object($table) && is_a($table, 'xmlElement') )) continue; - if ($table->Name != 'TABLE') continue; - $name = $table->Attributes['name']; - - $this->mTables[$name] = array( 'name' => $name, - 'fields' => array(), - 'keys' => array() - ); - - foreach($table->Contents as $tag) { - switch($tag->Name) { - case 'FIELDS': - $this->mTables[$name]['fields'] = $this->parseFields($tag); - break; - - case 'KEYS': - $this->mTables[$name]['keys'] = $this->parseKeys($tag); - break; - - case 'ROWS': - $this->mTables[$name]['data'] = $this->parseData($tag); - break; - } - } - } - // Free up space - $this->mDBTag = false; - } /*** PRIVATE FUNCTIONS ***/ - /*private*/ function parseFields($fieldtag) { - $rtn = array(); - foreach($fieldtag->Contents as $tag) { - if ($tag->Name != 'FIELD') continue; - $field = array(); - $field['name'] = $tag->Attributes['name']; - if (isset($tag->Attributes['null'])) - $field['null'] = ofConvert2Bool($tag->Attributes['null'], array('null')); - if (isset($tag->Attributes['autoincrement'])) - $field['auto'] = ofConvert2Bool($tag->Attributes['autoincrement'], array('autoincrement')); - - foreach($tag->Contents as $partstag) { - switch($partstag->Name) { - case 'TYPE': - $field['type'] = $partstag->getTextContents(); - break; - - case 'SET': - case 'ENUM': - $field['type'] = $partstag->Name; - //Parse contents - $values = array(); - foreach($partstag->Children as $value) { - $values[] = $value->getTextContents(); - } - $field['values'] = $values; - break; - - case 'DEFAULT': - $field['default'] = $partstag->getTextContents(); - break; - } - } - - $rtn[$field['name']] = $field; - } - - return $rtn; - } - - /** - */ - /*private*/ function parseKeys($keytag) { - $rtn = array(); - foreach($keytag->Contents as $tag) { - if ($tag->Name != 'KEY') continue; - $key = array(); - $key['type'] = 'index'; - if (isset($tag->Attributes['type'])) $key['type'] = $tag->Attributes['type']; - $key['name'] = $tag->Attributes['name']; - if ( (strcasecmp($key['type'], 'primary') == 0) || (strcasecmp($key['name'], 'primary') == 0) ) { - $key['type'] = 'primary'; - $key['name'] = 'PRIMARY'; - } else if ( $key['type'] && - strcasecmp($key['type'], 'primary') && - strcasecmp($key['type'], 'unique') && - strcasecmp($key['type'], 'index') ) { - // invalid key type. Skip this tag - continue; - } - - $key['cols'] = array(); - foreach($tag->Contents as $coltag) { - $key['cols'][] = $coltag->getTextContents(); - } - $rtn[$key['name']] = $key; - } - - return $rtn; - } - - /** - */ - /*private*/ function parseData($datatag) { - $rtn = array(); - foreach($datatag->Contents as $tag) { - if ($tag->Name != 'ROW') continue; - $row = array(); - foreach($tag->Contents as $coltag) { - $row[$coltag->Attributes['name']] = $coltag->getTextContents(); - } - $rtn[] = $row; - } - - return $rtn; - } /*private*/ function getModuleDTD() { --- 164,169 ---- *************** *** 370,375 **** $this->mTables[$this->mxmlCurTable]['fields'][$this->mxmlCurField]['type'] = $name; $this->mTables[$this->mxmlCurTable]['fields'][$this->mxmlCurField]['values'] = array(); - } } --- 252,265 ---- $this->mTables[$this->mxmlCurTable]['fields'][$this->mxmlCurField]['type'] = $name; $this->mTables[$this->mxmlCurTable]['fields'][$this->mxmlCurField]['values'] = array(); } + else if ($name == 'ROW' && in_array('ROWS', $this->mTagStack)) { + $this->mxmlCurRow = array(); + } + else if ($name == 'ROWS' && in_array('TABLE', $this->mTagStack)) { + $this->mTables[$this->mxmlCurTable]['data'] = array(); + } + else if (in_array('ROW', $this->mTagStack)) { + if (isset($attrs['NAME'])) $this->mxmlCurField = $attrs['NAME']; + } } *************** *** 378,381 **** --- 268,272 ---- if (count($this->mTagStack) > 1) $par_name = $this->mTagStack[count($this->mTagStack)-2]; // One for the zero start, one for second from end + if ($name == 'NAME') { $this->mName = $this->mxmlCurTag->getTextContents(); *************** *** 406,409 **** --- 297,305 ---- } else if ($par_name == 'SET' || $par_name == 'ENUM') { $this->mTables[$this->mxmlCurTable]['fields'][$this->mxmlCurField]['values'][] = $this->mxmlCurTag->getTextContents(); + } else if ($name == 'ROW') { + $this->mTables[$this->mxmlCurTable]['data'][] = $this->mxmlCurRow; + $this->mxmlCurRow = false; + } else if ($par_name == 'ROW') { + $this->mxmlCurRow[$this->mxmlCurField] = $this->mxmlCurTag->getTextContents(); } |
From: Jamie <ast...@us...> - 2005-09-11 05:45:30
|
Update of /cvsroot/openfirst/www/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14832/www/inc Modified Files: headers.php Log Message: Mac encoding Index: headers.php =================================================================== RCS file: /cvsroot/openfirst/www/inc/headers.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** headers.php 11 Sep 2005 05:15:53 -0000 1.24 --- headers.php 11 Sep 2005 05:45:23 -0000 1.25 *************** *** 10,14 **** include("versions.php"); ! if((isset($_GET["img"]) && $_GET["img"] == "") || !isset($_GET["img"])) { /* function microtime_diff($a, $b) { --- 10,14 ---- include("versions.php"); ! if ( (isset($_GET["img"]) && $_GET["img"] == "") || !isset($_GET["img"]) ) { /* function microtime_diff($a, $b) { |
From: Jamie <ast...@us...> - 2005-09-11 05:16:01
|
Update of /cvsroot/openfirst/www/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10161/www/inc Modified Files: headers.php Log Message: Fixing Dan's bug Index: headers.php =================================================================== RCS file: /cvsroot/openfirst/www/inc/headers.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** headers.php 11 Sep 2005 05:09:38 -0000 1.23 --- headers.php 11 Sep 2005 05:15:53 -0000 1.24 *************** *** 10,14 **** include("versions.php"); ! if($_GET["img"] == "") { /* function microtime_diff($a, $b) { --- 10,14 ---- include("versions.php"); ! if((isset($_GET["img"]) && $_GET["img"] == "") || !isset($_GET["img"])) { /* function microtime_diff($a, $b) { |
From: Jamie <ast...@us...> - 2005-09-11 05:09:47
|
Update of /cvsroot/openfirst/www/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9396/www/inc Modified Files: footers.php headers.php Log Message: Updates for Dan Index: footers.php =================================================================== RCS file: /cvsroot/openfirst/www/inc/footers.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** footers.php 3 Sep 2005 21:20:07 -0000 1.7 --- footers.php 11 Sep 2005 05:09:38 -0000 1.8 *************** *** 5,8 **** --- 5,9 ---- </div><!-- end div.container --> + <br /> <div class="bottom"> *************** *** 17,22 **** */ ?>. <a href="/source.php?url=<?php ! echo($_SERVER["SCRIPT_NAME"]);?> ! ">Show Source</a></p> </div> <div style="float: right;"> --- 18,23 ---- */ ?>. <a href="/source.php?url=<?php ! echo($_SERVER["SCRIPT_NAME"]); ! ?>">Show Source</a></p> </div> <div style="float: right;"> Index: headers.php =================================================================== RCS file: /cvsroot/openfirst/www/inc/headers.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** headers.php 3 Sep 2005 21:20:07 -0000 1.22 --- headers.php 11 Sep 2005 05:09:38 -0000 1.23 *************** *** 30,43 **** <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Language" content="en-CA" /> ! <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 href="/global.css" rel="stylesheet" type="text/css" /> ! </head> ! <body> <div class="top"> <div><h1><img src="/image/openfirst.png" alt="openFIRST Portal System" /></h1></div> <div id="topmenu" style="background-image: url('/image/back.gif');"> » <a accesskey="h" href="http://openfirst.sourceforge.net"><span class="u">H</span>ome</a> --- 30,49 ---- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Language" content="en-CA" /> ! <meta name="copyright" content="Copyright 2003-2006 openFIRST http://openfirst.sf.net." /> <meta name="author" content="OpenFIRST - http://openfirst.sf.net" /> <meta name="generator" content="OpenFIRST - http://openfirst.sf.net" /> <link href="/global.css" rel="stylesheet" type="text/css" /> ! <style type="text/css"> ! <?php ! // Internal styles moved to global.css 9/5/05 ! ?> ! </style> ! </head> ! <body> <div class="top"> <div><h1><img src="/image/openfirst.png" alt="openFIRST Portal System" /></h1></div> + <br /> <div id="topmenu" style="background-image: url('/image/back.gif');"> » <a accesskey="h" href="http://openfirst.sourceforge.net"><span class="u">H</span>ome</a> *************** *** 48,61 **** | » <a accesskey="b" href="/bugreports.php"><span class="u">B</span>ug Reports</a> | » <a accesskey="c" href="/contact.php"><span class="u">C</span>ontact Us</a> ! </div> <div style="background-image: url('/image/back-light.gif');"> <p>Welcome to the OpenFIRST Portal Development Website!</p> </div> </div><!-- end div.top --> ! <div class="container"> <div class="left"> <div> ! <a href="http://www.openfirst.org/"><img src="http://blog.openfirst.org/img/poweredby-openfirst.gif" alt="openFIRST Powered" style="border: 0px;"></a> </div> <div> --- 54,67 ---- | » <a accesskey="b" href="/bugreports.php"><span class="u">B</span>ug Reports</a> | » <a accesskey="c" href="/contact.php"><span class="u">C</span>ontact Us</a> ! </div><br /> <div style="background-image: url('/image/back-light.gif');"> <p>Welcome to the OpenFIRST Portal Development Website!</p> </div> </div><!-- end div.top --> ! <br /> <div class="container"> <div class="left"> <div> ! <a href="http://www.openfirst.org/"><img src="http://blog.openfirst.org/img/poweredby-openfirst.gif" alt="openFIRST Powered" style="border: 0px;" /></a> </div> <div> *************** *** 83,98 **** <br /> <br /> ! <h3>openFIRST was developed with:</h3><br> <br /> ! <img alt="XHTML 1.0" src="/image/powered/xhtml-1.0.png"> ! <br /><img alt="Apache" src="/image/powered/apache.gif"> ! <br /><img alt="Microsoft IIS" src="/image/powered/ms-iis.png"> ! <br /><img alt="Sambar" src="/image/powered/sambar.png"> ! <br /><img alt="PHP" src="/image/powered/php-power-micro2.png"> ! <br /><img alt="MySQL" src="/image/powered/mysql.gif"> <br />(Other databases are also supported) <br /> <br /> ! <a href="http://www.firsttopsite.com/index.php?id=92"><img src="http://www.firsttopsite.com/img.php?id=92" style="border: none;" alt="FIRST Top Site"></a> </div> <div> --- 89,104 ---- <br /> <br /> ! <h3>openFIRST was developed with:</h3><br /> <br /> ! <img alt="XHTML 1.0" src="/image/powered/xhtml-1.0.png" /> ! <br /><img alt="Apache" src="/image/powered/apache.gif" /> ! <br /><img alt="Microsoft IIS" src="/image/powered/ms-iis.png" /> ! <br /><img alt="Sambar" src="/image/powered/sambar.png" /> ! <br /><img alt="PHP" src="/image/powered/php-power-micro2.png" /> ! <br /><img alt="MySQL" src="/image/powered/mysql.gif" /> <br />(Other databases are also supported) <br /> <br /> ! <a href="http://www.firsttopsite.com/index.php?id=92"><img src="http://www.firsttopsite.com/img.php?id=92" style="border: none;" alt="FIRST Top Site" /></a> </div> <div> *************** *** 101,106 **** <noscript><p>Bugzilla Stat Chart is not available at this time.</p></noscript> </div> - - </div><!-- end div.left --> --- 107,110 ---- |
From: Jamie <ast...@us...> - 2005-09-11 05:09:46
|
Update of /cvsroot/openfirst/www/htdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9396/www/htdocs Modified Files: global.css Log Message: Updates for Dan Index: global.css =================================================================== RCS file: /cvsroot/openfirst/www/htdocs/global.css,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** global.css 3 Sep 2005 21:18:24 -0000 1.1 --- global.css 11 Sep 2005 05:09:38 -0000 1.2 *************** *** 2,14 **** h1 { color: #000000; font-size: 18px; font-family: sans-serif; text-decoration: none; font-weight: 900; } h3 { font-size: 12px; font-family: sans-serif; text-decoration: none; font-weight: 700; margin: 0px; padding: 0px; } ! u { text-decoration: underline; } a:link { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } a:visited { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } ! a:active { color: #0000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } a:hover { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } div.top { width: 100%; padding: 2px 4px 4px 3px; border: 1px solid #999999; margin-left: auto; margin-right: auto; } ! div.top div { padding: 3px; float: left; border: none; } div.top p { margin: 0px; padding: 2px 2px 2px 0px; } div.bottom { width: 100%; padding: 3px 4px 2px 4px; border-color: #999999; border-style: solid; border-width: 1px 0px 0px 0px; margin-left: auto; margin-right: auto; } --- 2,14 ---- h1 { color: #000000; font-size: 18px; font-family: sans-serif; text-decoration: none; font-weight: 900; } h3 { font-size: 12px; font-family: sans-serif; text-decoration: none; font-weight: 700; margin: 0px; padding: 0px; } ! .u { text-decoration: underline; } a:link { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } a:visited { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } ! a:active { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } a:hover { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } div.top { width: 100%; padding: 2px 4px 4px 3px; border: 1px solid #999999; margin-left: auto; margin-right: auto; } ! div.top div { padding: 3px; float: left; border: none; clear: left; } div.top p { margin: 0px; padding: 2px 2px 2px 0px; } div.bottom { width: 100%; padding: 3px 4px 2px 4px; border-color: #999999; border-style: solid; border-width: 1px 0px 0px 0px; margin-left: auto; margin-right: auto; } *************** *** 16,23 **** div.bottom p { margin: 0px; padding: 4px; } ! container { display: inline; width: 100%; margin-left: auto; margin-right: auto; } ! left { width: 20%; float: left; background-image: url('/image/back-lighter.gif'); padding: 3px; margin: 0px 2px 4px 2px ; } ! left div { float: left; } ! content { width: 75%; float: right; padding: 5px; margin: 2px; } #topmenu { text-align: left; } --- 16,23 ---- div.bottom p { margin: 0px; padding: 4px; } ! .container { display: inline; width: 100%; margin-left: auto; margin-right: auto; clear: left; } ! .left { width: 20%; float: left; clear: left; background-image: url('/image/back-lighter.gif'); padding: 3px 5px 3px 3px; margin: 0px 0px 4px 2px ; } ! .left div { float: left; clear: left; } ! .content { width: 75%; float: right; padding: 5px; margin: 2px; } #topmenu { text-align: left; } |
From: Tim G. <xt...@us...> - 2005-09-03 21:20:16
|
Update of /cvsroot/openfirst/www/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16608 Modified Files: headers.php footers.php Log Message: Update site design on behalf of Daniel Zollman Index: footers.php =================================================================== RCS file: /cvsroot/openfirst/www/inc/footers.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** footers.php 20 Jul 2005 23:35:46 -0000 1.6 --- footers.php 3 Sep 2005 21:20:07 -0000 1.7 *************** *** 2,20 **** if(! isset($_GET["img"]) || $_GET["img"] == "") { ?> ! </td> ! </tr> ! </table> ! <table class="menu" width="100%" border="0" cellspacing="0" cellpadding="6"> ! <tr> ! <td class="menu" style="background=image: url('http://openfirst.sourceforge.net/image/back-light.gif');"> ! <div> ! <div align="center"><br> ! © Copyright 2002-2003 by the <a href="http://openfirst.sourceforge.net/developers/">openFIRST ! Development Team</a>. All rights reserved.</div> ! </div></td> ! </tr> ! <tr> ! <td class="menu"><div align="center"><br> ! <?php // Display processing time. /* --- 2,13 ---- if(! isset($_GET["img"]) || $_GET["img"] == "") { ?> ! </div><!-- end div.content --> ! </div><!-- end div.container --> ! ! ! <div class="bottom"> ! <div style="background-image: url('http://openfirst.sourceforge.net/image/back-light.gif');"> ! <p>© Copyright 2002-2003 by the <a href="http://openfirst.sourceforge.net/developers/">openFIRST Development Team</a>. All rights reserved.</p> ! <p><?php // Display processing time. /* *************** *** 23,49 **** echo ("Page generated in $duration seconds"); */ ! ?>. <a ! href="/source.php?url=<?php echo($_SERVER["SCRIPT_NAME"]);?> ! ">Show ! Source</a><br> ! </div></td> ! </tr> ! <tr> ! <td class="menu"> ! <div align="right"><img ! src="http://blog.openfirst.org/img/poweredby-openfirst.gif" ! alt="openFIRST Powered"></a> <a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=78233&type=4" ! width="125" height="37" border="0" ! alt="SourceForge.net" title="SourceForge.net"></a> ! </div></td> ! </tr> ! </table> ! <p> </p> ! </body> </html> <?php } ! ?> --- 16,33 ---- echo ("Page generated in $duration seconds"); */ ! ?>. <a href="/source.php?url=<?php echo($_SERVER["SCRIPT_NAME"]);?> ! ">Show Source</a></p> ! </div> ! <div style="float: right;"> ! <img src="http://blog.openfirst.org/img/poweredby-openfirst.gif" alt="openFIRST Powered" /></a> <a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=78233&type=4" ! width="125" height="37" style="border: none;" alt="SourceForge.net" title="SourceForge.net" /></a> ! </div> ! </div><!-- end div.bottom --> <p> </p> ! </body> </html> <?php } ! ?> \ No newline at end of file Index: headers.php =================================================================== RCS file: /cvsroot/openfirst/www/inc/headers.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** headers.php 20 Aug 2005 15:39:38 -0000 1.21 --- headers.php 3 Sep 2005 21:20:07 -0000 1.22 *************** *** 28,117 **** <head> <title>openFIRST Portal System</title> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <meta http-equiv="Content-Language" content="en-CA"> ! <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"> ! <style type="text/css"> ! #adminmenu { color: #ffffff; } ! #adminmenu a:link { color: #ffffff; } ! #adminmenu a:visited { color: #ffffff; } ! #adminmenu a:active { color: #ffffff; } ! #adminmenu a:hover { color: #ffffff; } ! ! a:link { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } ! a:visited { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } ! a:active { color: #0000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } ! a:hover { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } ! ! #topmenu { text-align: left; } ! #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; } ! ! table { border-left:solid #999999 1px;border-right:solid #999999 1px;border-bottom:solid #999999 1px; margin-left:auto; margin-right:auto; } ! 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; text-align: center; margin: 0px; } ! 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('/image/back-light.gif'); } ! td.sub { background-color: #999999; color: #333333;background-image: url('/image/back-lighter.gif'); } ! </style> </head> <body> ! <table width="100%" border="0" cellspacing="0" cellpadding="6"> ! <tr> ! <td> <img src="/image/openfirst.png" alt="openFIRST Portal System"> ! </td> ! </tr> ! <tr> ! <th id="topmenu" style="background-image: url('/image/back.gif');"> ! » <a accesskey="h" href="http://openfirst.sourceforge.net"><u>H</u>ome</a> ! | » <a accesskey="a" href="/about.php"><u>A</u>bout openFIRST</a> ! | » <a accesskey="o" href="/doc/">D<u>o</u>cumentation</a> ! | » <a accesskey="d" href="/downloads.php"><u>D</u>ownloads</a> ! | » <a accesskey="m" href="/modules.php"><u>M</u>odules</a> ! | » <a accesskey="e" href="/developers.php">Volunt<u>e</u>ers</a> ! | » <a accesskey="b" href="/bugreports.php"><u>B</u>ug Reports</a> ! | » <a accesskey="c" href="/contact.php"><u>C</u>ontact Us</a> ! </th> ! </tr> ! <tr> ! <td style="background-image: url('/image/back-light.gif'); "> ! <table width="100%" border="0" cellspacing="0" ! cellpadding="0"> ! <tr> ! <td width="63%"> Welcome to the openFIRST Portal Development ! Website! </td> ! </tr> ! </table></td> ! </tr> ! </table> ! <table width="100%"> ! <tr> ! <td width="20%" valign="top" style="background-image: url('/image/back-lighter.gif'); "><table width="100%" border="0"> ! <tr> ! <td><center><a href="http://www.openfirst.org/"><img src="http://blog.openfirst.org/img/poweredby-openfirst.gif" alt="openFIRST Powered" style="border: 0px;"></a></center></td> ! </tr> ! <tr> ! <td><strong><img alt="" src="/image/help.png"> What is ! openFIRST?</strong></td> ! </tr> ! <tr> ! <td>openFIRST is an integrated set of modules which ! may be used together to create or enhance a web site. It is directed ! towards teams participating in the FIRST competition.</td> ! </tr> ! <tr> ! <td><strong><img alt="" src="/image/misc.png"> Developers?</strong> ! </td> ! </tr> ! <tr> ! <td> openFIRST is developed by a number of students from the FIRST Robotics competition teams <a href="http://www.portperryrobotics.ca/">#1006</a>, <a href="http://www.archangelrobotics.com/">#1049</a>, --- 28,69 ---- <head> <title>openFIRST Portal System</title> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> ! <meta http-equiv="Content-Language" content="en-CA" /> ! <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 href="/global.css" rel="stylesheet" type="text/css" /> </head> <body> ! ! <div class="top"> ! <div><h1><img src="/image/openfirst.png" alt="openFIRST Portal System" /></h1></div> ! <div id="topmenu" style="background-image: url('/image/back.gif');"> ! » <a accesskey="h" href="http://openfirst.sourceforge.net"><span class="u">H</span>ome</a> ! | » <a accesskey="a" href="/about.php"><span class="u">A</span>bout openFIRST</a> ! | » <a accesskey="o" href="/doc/">D<span class="u">o</span>cumentation</a> ! | » <a accesskey="d" href="/downloads.php"><span class="u">D</span>ownloads</a> ! | » <a accesskey="e" href="/developers.php">Volunt<span class="u">e</span>ers</a> ! | » <a accesskey="b" href="/bugreports.php"><span class="u">B</span>ug Reports</a> ! | » <a accesskey="c" href="/contact.php"><span class="u">C</span>ontact Us</a> ! </div> ! <div style="background-image: url('/image/back-light.gif');"> ! <p>Welcome to the OpenFIRST Portal Development Website!</p> ! </div> ! </div><!-- end div.top --> ! ! <div class="container"> ! <div class="left"> ! <div> ! <a href="http://www.openfirst.org/"><img src="http://blog.openfirst.org/img/poweredby-openfirst.gif" alt="openFIRST Powered" style="border: 0px;"></a> ! </div> ! <div> ! <img alt="?" src="/image/help.png" /> <h3>What is openFIRST?</h3> ! <p>OpenFIRST is an integrated set of modules which may be used together to create or enhance a web site. It is directed towards teams participating in the FIRST competition.</p> ! </div> ! <div> ! <img alt="?" src="/image/misc.png" /> <h3>Developers?</h3> ! <p>OpenFIRST is developed by a number of students from the FIRST Robotics competition teams <a href="http://www.portperryrobotics.ca/">#1006</a>, <a href="http://www.archangelrobotics.com/">#1049</a>, *************** *** 119,161 **** <a href="http://www.sinclairsprockets.com/">#1075</a>, <a href="http://www.teamthrust.us/">#1501</a>, ! #1227, and #1257. You may ! <a href="/developers/">read more about the ! developers</a>. To learn how to contribute to the project, and for a technical reference about writing modifications / patches / enhancements for the openFIRST system, read the <a href="/doc/tut/howto/">openFIRST Contributor's HOWTO</a>. New contributors are always welcome.</td> ! </tr> ! <tr> ! <td> <strong><img alt="" src="/image/gear.png"> USFIRST ! Robotics</strong></td> ! </tr> ! <tr> ! <td>USFIRST is the largest North American robotics competition that has over 800 teams and many competitions yearly. <a href="http://www.usfirst.org">Read ! more</a>.</td> ! </tr> ! </table> ! <p align="center"><a href="http://www.usfirst.org"><img alt="" src="/oflogo.php?img=firstlogo&type=1" border="0"></a> ! <br> ! <br> ! <strong>openFIRST was developed with:</strong><br> ! <br><center> ! <img alt="XHTML 1.0" src="/image/powered/xhtml-1.0.png"> ! <br><img alt="Apache" src="/image/powered/apache.gif"> ! <br><img alt="Microsoft IIS" src="/image/powered/ms-iis.png"> ! <br><img alt="Sambar" src="/image/powered/sambar.png"> ! <br><img alt="PHP" src="/image/powered/php-power-micro2.png"> ! <br><img alt="MySQL" src="/image/powered/mysql.gif"> ! <br>(Other databases are also supported)</p> - <p><a href="http://www.firsttopsite.com/index.php?id=92" target="_blank"><img src="http://www.firsttopsite.com/img.php?id=92" border="0" alt="0"></a><p> ! </center> ! <p><b>Bugzilla Stats</b> ! <script type="text/javascript" src="http://bugzilla.openfirst.org/openfirst/bugcrushers.php?style=js"></script> ! <br> ! <br> ! <br> ! </p> ! </td> ! <td width="75%" valign="top"> ! <?php } } ?> --- 71,110 ---- <a href="http://www.sinclairsprockets.com/">#1075</a>, <a href="http://www.teamthrust.us/">#1501</a>, ! #1227, and #1257. You may read more about the developers <a href="/developers/">here</a>. To learn how to contribute to the project, and for a technical reference about writing modifications / patches / enhancements for the openFIRST system, read the <a href="/doc/tut/howto/">openFIRST Contributor's HOWTO</a>. New contributors are always welcome.</p> ! </div> ! <div> ! <img alt="gear" src="/image/gear.png" /> <h3>USFIRST Robotics</h3> ! <p>USFIRST is the largest North American robotics competition that has over 800 teams and many competitions yearly. <a href="http://www.usfirst.org">Read ! more</a>.</p> ! </div> ! <div> ! <a href="http://www.usfirst.org"><img alt="USFIRST Logo" src="/oflogo.php?img=firstlogo&type=1" style="border: none;"></a> ! <br /> ! <br /> ! <h3>openFIRST was developed with:</h3><br> ! <br /> ! <img alt="XHTML 1.0" src="/image/powered/xhtml-1.0.png"> ! <br /><img alt="Apache" src="/image/powered/apache.gif"> ! <br /><img alt="Microsoft IIS" src="/image/powered/ms-iis.png"> ! <br /><img alt="Sambar" src="/image/powered/sambar.png"> ! <br /><img alt="PHP" src="/image/powered/php-power-micro2.png"> ! <br /><img alt="MySQL" src="/image/powered/mysql.gif"> ! <br />(Other databases are also supported) ! <br /> ! <br /> ! <a href="http://www.firsttopsite.com/index.php?id=92"><img src="http://www.firsttopsite.com/img.php?id=92" style="border: none;" alt="FIRST Top Site"></a> ! </div> ! <div> ! <h3>Bugzilla Stats</h3> ! <script type="text/javascript" src="http://bugzilla.openfirst.org/openfirst/bugcrushers.php?style=js"></script> ! <noscript><p>Bugzilla Stat Chart is not available at this time.</p></noscript> ! </div> ! ! </div><!-- end div.left --> ! <div class="content"> ! <?php } } ?> |
From: Tim G. <xt...@us...> - 2005-09-03 21:18:33
|
Update of /cvsroot/openfirst/www/htdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16256 Added Files: global.css Log Message: Add stylesheet on behalf of Daniel Zollman --- NEW FILE: global.css --- body { background-color: #FFFFFF; color: #000000; font-size: 12px; font-family: sans-serif; } h1 { color: #000000; font-size: 18px; font-family: sans-serif; text-decoration: none; font-weight: 900; } h3 { font-size: 12px; font-family: sans-serif; text-decoration: none; font-weight: 700; margin: 0px; padding: 0px; } u { text-decoration: underline; } a:link { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } a:visited { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } a:active { color: #0000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } a:hover { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } div.top { width: 100%; padding: 2px 4px 4px 3px; border: 1px solid #999999; margin-left: auto; margin-right: auto; } div.top div { padding: 3px; float: left; border: none; } div.top p { margin: 0px; padding: 2px 2px 2px 0px; } div.bottom { width: 100%; padding: 3px 4px 2px 4px; border-color: #999999; border-style: solid; border-width: 1px 0px 0px 0px; margin-left: auto; margin-right: auto; } div.bottom div { padding: 3px; float: left; border: none; } div.bottom p { margin: 0px; padding: 4px; } container { display: inline; width: 100%; margin-left: auto; margin-right: auto; } left { width: 20%; float: left; background-image: url('/image/back-lighter.gif'); padding: 3px; margin: 0px 2px 4px 2px ; } left div { float: left; } content { width: 75%; float: right; padding: 5px; margin: 2px; } #topmenu { text-align: left; } #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; } table { border-left: solid #999999 1px; border-right: solid #999999 1px; border-bottom: solid #999999 1px; margin-left: auto; margin-right: auto; } 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; text-align: center; margin: 0px; } 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('/image/back-light.gif'); } td.sub { background-color: #999999; color: #333333; background-image: url('/image/back-lighter.gif'); } #adminmenu { color: #ffffff; } #adminmenu a:link { color: #ffffff; } #adminmenu a:visited { color: #ffffff; } #adminmenu a:active { color: #ffffff; } #adminmenu a:hover { color: #ffffff; } |
From: Jamie <ast...@us...> - 2005-08-28 03:43:40
|
Update of /cvsroot/openfirst/downloads/setup In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25250/downloads/setup Modified Files: Tag: REL1_1_BRANCH setup.mysql Log Message: All modules install (under MySQL). Emoticon known to work. -install.php updated to current method -problems with auth.php fixed? (Watch auth.php, it's a tricky one) -ofirst_dbfetch_array() added (Need to port to HEAD) -var name mismatch fixed in globals.php -serious updates to logger (no longer tracks total and pagetotal) -issues with poll removed Index: setup.mysql =================================================================== RCS file: /cvsroot/openfirst/downloads/setup/setup.mysql,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** setup.mysql 23 Nov 2003 17:28:19 -0000 1.2 --- setup.mysql 28 Aug 2005 03:43:29 -0000 1.2.2.1 *************** *** 1,3 **** CREATE TABLE `ofirst_downloads` (`ID` bigint(12) unsigned NOT NULL auto_increment, `Category` varchar(35) NOT NULL default '', `Title` tinytext NOT NULL, `Description` mediumtext, `mime` tinytext, `ext` tinytext, `DateAdded` date NOT NULL default '0000-00-00', `FileData` longblob NOT NULL, `hits` int(12) default '0', PRIMARY KEY (`ID`), UNIQUE KEY `ID` (`ID`), KEY `ID_2` (`ID`)) TYPE=MyISAM CREATE TABLE `ofirst_downloadcat` (`ID` int(12) NOT NULL auto_increment, `Category` varchar(35) NOT NULL default '', `Description` tinytext, `Icon` tinytext, PRIMARY KEY (`ID`), UNIQUE KEY `ID` (`ID`,`Category`(12)), KEY `ID_2` (`ID`)) TYPE=MyISAM ! INSERT INTO ofirst_config SET modulename='downloads',showonmenu='0',active='0',adminnavigation='<a href="$basepath/downloads/admin">Category Editor</a>',modulenavigation='<a href="$basepath/downloads/">Downloads Home</a>',includes=''; --- 1,3 ---- CREATE TABLE `ofirst_downloads` (`ID` bigint(12) unsigned NOT NULL auto_increment, `Category` varchar(35) NOT NULL default '', `Title` tinytext NOT NULL, `Description` mediumtext, `mime` tinytext, `ext` tinytext, `DateAdded` date NOT NULL default '0000-00-00', `FileData` longblob NOT NULL, `hits` int(12) default '0', PRIMARY KEY (`ID`), UNIQUE KEY `ID` (`ID`), KEY `ID_2` (`ID`)) TYPE=MyISAM CREATE TABLE `ofirst_downloadcat` (`ID` int(12) NOT NULL auto_increment, `Category` varchar(35) NOT NULL default '', `Description` tinytext, `Icon` tinytext, PRIMARY KEY (`ID`), UNIQUE KEY `ID` (`ID`,`Category`(12)), KEY `ID_2` (`ID`)) TYPE=MyISAM ! REPLACE INTO ofirst_config SET modulename='downloads',showonmenu='0',active='0',adminnavigation='<a href="$basepath/downloads/admin">Category Editor</a>',modulenavigation='<a href="$basepath/downloads/">Downloads Home</a>',includes=''; |
From: Jamie <ast...@us...> - 2005-08-28 03:43:40
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25250/includes Modified Files: Tag: REL1_1_BRANCH auth.php dbase.php globals.php Log Message: All modules install (under MySQL). Emoticon known to work. -install.php updated to current method -problems with auth.php fixed? (Watch auth.php, it's a tricky one) -ofirst_dbfetch_array() added (Need to port to HEAD) -var name mismatch fixed in globals.php -serious updates to logger (no longer tracks total and pagetotal) -issues with poll removed Index: auth.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/auth.php,v retrieving revision 1.5.2.4 retrieving revision 1.5.2.5 diff -C2 -d -r1.5.2.4 -r1.5.2.5 *** auth.php 25 Aug 2005 00:16:31 -0000 1.5.2.4 --- auth.php 28 Aug 2005 03:43:29 -0000 1.5.2.5 *************** *** 98,102 **** function InitUser() { ! global $pass_save_disabled, $encryption, $user; // Determine if the user has already logged in with this session. If // they have, set variables indicating this. If they have not, make a --- 98,103 ---- function InitUser() { ! global $pass_save_disabled, $encryption, $user, $basepath; ! session_start(); // Determine if the user has already logged in with this session. If // they have, set variables indicating this. If they have not, make a *************** *** 113,117 **** $_SESSION['authcode'] = $authcode; //renew cookie ! setcookie("openFIRSTlogin", $authcode, time()+2592000, "/"); } else { $authcode = 0; --- 114,118 ---- $_SESSION['authcode'] = $authcode; //renew cookie ! setcookie("openFIRSTlogin", $authcode, time()+2592000, $basepath); } else { $authcode = 0; *************** *** 126,130 **** if(!isset($pass_save_disabled)){ //delete cookie ! setcookie("openFIRSTlogin"," ",time()-3600,"/"); } if(isset($_POST["login"])){ --- 127,131 ---- if(!isset($pass_save_disabled)){ //delete cookie ! setcookie("openFIRSTlogin"," ",time()-3600,$basepath); } if(isset($_POST["login"])){ *************** *** 140,143 **** --- 141,145 ---- $aquery = ofirst_dbquery("UPDATE ofirst_members SET authcode='" . $_SESSION["authcode"] . "' WHERE user='" . $_POST["login"] . "';"); } else { + header('X-openFIRST-login-error: invalid password'); unset($user); } *************** *** 161,165 **** if(isset($_POST["savepass"])&&$_POST["savepass"]="1"){ //save authcode in a cookie ! setcookie("openFIRSTlogin",$_SESSION["authcode"],time()+2592000,"/"); } else { //delete cookie --- 163,167 ---- if(isset($_POST["savepass"])&&$_POST["savepass"]="1"){ //save authcode in a cookie ! setcookie("openFIRSTlogin",$_SESSION["authcode"],time()+2592000,$basepath); } else { //delete cookie *************** *** 170,173 **** --- 172,176 ---- } else { # invalid password! + header('X-openFIRST-login-error: invalid password'); unset($user); } *************** *** 175,178 **** --- 178,182 ---- } else { # invalid user! + header('X-openFIRST-login-error: invalid user'); unset($user); } Index: dbase.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/dbase.php,v retrieving revision 1.7.2.5 retrieving revision 1.7.2.6 diff -C2 -d -r1.7.2.5 -r1.7.2.6 *** dbase.php 25 Aug 2005 01:15:36 -0000 1.7.2.5 --- dbase.php 28 Aug 2005 03:43:29 -0000 1.7.2.6 *************** *** 145,149 **** function ofirst_dbquery($string, $linkidentifier = "", $batchsize = "") { ! global $dbasetype, $sqlconnection; if($dbasetype == "mysql") { if(function_exists("mysql_query") == false) { --- 145,150 ---- function ofirst_dbquery($string, $linkidentifier = "", $batchsize = "") { ! global $dbasetype, $sqlconnection, $lastquery; ! $lastquery = $string; if($dbasetype == "mysql") { if(function_exists("mysql_query") == false) { *************** *** 203,206 **** --- 204,235 ---- } + function ofirst_dbfetch_array($resource, $rownumber = "") { + global $dbasetype; + if($dbasetype == "mysql") { + if(function_exists("mysql_fetch_assoc") == false) { + die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); + } + return mysql_fetch_assoc($resource); + } elseif($dbasetype == "mssql") { + if(function_exists("mssql_fetch_assoc") == false) { + die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); + } + //@NOTE mssql_fetch_assoc() is undocumented. + return(mssql_fetch_assoc($resource)); + } elseif($dbasetype == "odbc") { + if(function_exists("odbc_fetch_array ") == false) { + die("ODBC support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type."); + + } + if($rownumber != "") { + return(odbc_fetch_array ($resource, $rownumber)); + } else { + return(odbc_fetch_array ($resource)); + } + } + + exit(0); + } + function ofirst_dbnum_rows($resource) { global $dbasetype; *************** *** 312,317 **** `modulenavigation` text, `includes` text, ! PRIMARY KEY (`modulename`), ! UNIQUE (`modulename`) )"); if (ofirst_dberror() != 0) return false; --- 341,345 ---- `modulenavigation` text, `includes` text, ! PRIMARY KEY (`modulename`) )"); if (ofirst_dberror() != 0) return false; *************** *** 359,373 **** function ofirst_dbexec_file($filename, $linkidentifier = "") { if (file_exists($filename) && is_readable($filename) && is_file($filename)) { ! /* $sf = fopen($filename, "r"); $query = ""; while($line = fgets($sf)) { if(substr($line, 0, 2) != "--" && substr($line, 0, 1) != "#" && strlen($line) > 0) { ! $q = ofirst_dbquery(trim($line)); } } ! fclose($sf);*/ ! $line = file_get_contents($filename); $q = ofirst_dbquery(trim($line), $linkidentifier); ! return ofirst_dberrno($linkidentifier) ? ofirst_dberror($linkidentifier) : false; } else { return "Can't read file"; --- 387,404 ---- function ofirst_dbexec_file($filename, $linkidentifier = "") { if (file_exists($filename) && is_readable($filename) && is_file($filename)) { ! $sf = fopen($filename, "r"); $query = ""; while($line = fgets($sf)) { + $line = trim($line); if(substr($line, 0, 2) != "--" && substr($line, 0, 1) != "#" && strlen($line) > 0) { ! $q = ofirst_dbquery($line); ! if (ofirst_dberrno($linkidentifier) != 0) return ofirst_dberror($linkidentifier); } } ! fclose($sf); ! return false; ! /* $line = file_get_contents($filename); $q = ofirst_dbquery(trim($line), $linkidentifier); ! return ofirst_dberrno($linkidentifier) ? ofirst_dberror($linkidentifier) : false;*/ } else { return "Can't read file"; Index: globals.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/globals.php,v retrieving revision 1.14.2.4 retrieving revision 1.14.2.5 diff -C2 -d -r1.14.2.4 -r1.14.2.5 *** globals.php 25 Aug 2005 01:15:36 -0000 1.14.2.4 --- globals.php 28 Aug 2005 03:43:29 -0000 1.14.2.5 *************** *** 106,110 **** // Include the functions using glob(); foreach (glob("$fbasepath/includes/functions/*.php") as $filename) { ! // include_once($filename); } } --- 106,110 ---- // Include the functions using glob(); foreach (glob("$fbasepath/includes/functions/*.php") as $filename) { ! include_once($filename); } } *************** *** 143,147 **** if( (bool) $module->showonmenu == true) { // If it is the current module then color the item ! if ($currentmodule == $module->modulename){ $headers .= " » <font color='red'><u><a class='menu' href='$basepath/$module->modulename'>".ucwords($module->modulename)."</a></u></font> |"; --- 143,147 ---- if( (bool) $module->showonmenu == true) { // If it is the current module then color the item ! if ($curmodule == $module->modulename){ $headers .= " » <font color='red'><u><a class='menu' href='$basepath/$module->modulename'>".ucwords($module->modulename)."</a></u></font> |"; |
From: Jamie <ast...@us...> - 2005-08-28 03:43:40
|
Update of /cvsroot/openfirst/logger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25250/logger Modified Files: Tag: REL1_1_BRANCH logger.php Log Message: All modules install (under MySQL). Emoticon known to work. -install.php updated to current method -problems with auth.php fixed? (Watch auth.php, it's a tricky one) -ofirst_dbfetch_array() added (Need to port to HEAD) -var name mismatch fixed in globals.php -serious updates to logger (no longer tracks total and pagetotal) -issues with poll removed Index: logger.php =================================================================== RCS file: /cvsroot/openfirst/logger/logger.php,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -C2 -d -r1.10 -r1.10.2.1 *** logger.php 24 Dec 2003 19:32:20 -0000 1.10 --- logger.php 28 Aug 2005 03:43:29 -0000 1.10.2.1 *************** *** 53,56 **** --- 53,57 ---- $BROWSER = "Unknown"; } + $BROWSER = ofirst_dbescape($BROWSER); if (ISSET($_SERVER['QUERY_STRING'])) { *************** *** 75,124 **** ,'".$MEMBER."')") or die(ofirst_dberror()); ! // Total Pages Served counter ! $totalpg=get_totalpages()+1; ! if ($totalpg==1) { ! ofirst_dbquery("INSERT INTO ofirst_hitcount (Name,Value) values ('totalpages','1');"); ! } else { ! ofirst_dbquery('UPDATE ofirst_hitcount SET Value="'.$totalpg.'" WHERE Name="totalpages";'); ! } ! unset($totalpg); ! ! // Visitor counter ! ! if(!isset($_SESSION["FirstHit"])) { ! $_SESSION["FirstHit"]=1; ! ! $total=get_visitors()+1; ! if ($total==1){ ! ofirst_dbquery("INSERT INTO ofirst_hitcount (Name,Value) values ('total','1');"); ! } else { ! ofirst_dbquery('UPDATE ofirst_hitcount SET Value="'.$total.'" WHERE Name="total";'); ! } ! ! // Browser individual hit counter ! $query=ofirst_dbquery('SELECT Value FROM ofirst_hitcount WHERE Name="'.$BROWSER.'"'); ! $total=ofirst_dbfetch_object($query); ! $total=($total->Value)+1; ! if ($total==1) { ! ofirst_dbquery("INSERT INTO ofirst_hitcount (Name,Value) values ('".$BROWSER."','1');"); ! } else { ! ofirst_dbquery('UPDATE ofirst_hitcount SET Value="'.$total.'" WHERE Name="'.$BROWSER.'";'); ! } ! unset($total); } function get_visitors() { ! $query=ofirst_dbquery('SELECT Value FROM ofirst_hitcount WHERE Name="total"'); ! //Get current value ! $visits=ofirst_dbfetch_object($query); ! return ($visits->Value); } function get_totalpages() { ! $query=ofirst_dbquery('SELECT Value FROM ofirst_hitcount WHERE Name="totalpages"'); ! $visits=ofirst_dbfetch_object($query); ! return ($visits->Value); } --- 76,104 ---- ,'".$MEMBER."')") or die(ofirst_dberror()); ! // Browser individual hit counter ! $query=ofirst_dbquery('SELECT COUNT(Value) FROM ofirst_hitcount WHERE Name="'.$BROWSER.'"'); ! $total=ofirst_dbfetch_array($query); ! $total=$total['COUNT(Value)']; ! if ($total<=0) { ! ofirst_dbquery("INSERT INTO ofirst_hitcount (Name,Value) VALUES ('".$BROWSER."','1');"); ! } else { ! ofirst_dbquery('UPDATE ofirst_hitcount SET Value=Value+1 WHERE Name="'.$BROWSER.'"'); } + unset($total); function get_visitors() { ! $query=ofirst_dbquery('SELECT COUNT(Value) FROM `ofirst_hitcount`'); ! // @FIXME Get real array interface, no hacking ! $visits=ofirst_dbfetch_array($query); ! return ($visits['COUNT(Value)']); } function get_totalpages() { ! $query=ofirst_dbquery('SELECT SUM(Value) FROM `ofirst_hitcount`'); ! // @FIXME Get real array interface, no hacking ! $visits=ofirst_dbfetch_array($query); ! return ($visits['SUM(Value)']); } |
From: Jamie <ast...@us...> - 2005-08-28 03:43:40
|
Update of /cvsroot/openfirst/emoticon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25250/emoticon Modified Files: Tag: REL1_1_BRANCH emoticonf.php index.php Log Message: All modules install (under MySQL). Emoticon known to work. -install.php updated to current method -problems with auth.php fixed? (Watch auth.php, it's a tricky one) -ofirst_dbfetch_array() added (Need to port to HEAD) -var name mismatch fixed in globals.php -serious updates to logger (no longer tracks total and pagetotal) -issues with poll removed Index: emoticonf.php =================================================================== RCS file: /cvsroot/openfirst/emoticon/emoticonf.php,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -C2 -d -r1.14 -r1.14.2.1 *** emoticonf.php 7 Apr 2004 11:45:12 -0000 1.14 --- emoticonf.php 28 Aug 2005 03:43:29 -0000 1.14.2.1 *************** *** 48,59 **** // or have as reference page. ! function emoticon_preview ($limit = 5, $start = 0) { global $basepath; ! $query = ofirst_dbquery("SELECT * FROM ofirst_emoticon LIMIT $start OFFSET $limit"); ! echo "<table><th>Emoticons</th><th></th>"; ! while ($emot = ofirst_dbfetch_object($query)) { ! echo "<tr><td>".$emot->substitution."</td><td>".$emot->emoticon."</td></tr>"; } - echo "<td><a href='$basepath/emoticon/'>Show more...</a></td></table>"; } --- 48,90 ---- // or have as reference page. ! function emoticon_preview ($limit = 5, $start = 0, $showfoot = true) { global $basepath; ! $query = ofirst_dbquery("SELECT * FROM `ofirst_emoticon` LIMIT $limit OFFSET $start"); ! if ($query && ofirst_dberrno() == 0) { ! echo "<table>"; ! echo "<thead><tr><th colspan=\"2\">Emoticons</th></tr></thead>"; ! echo "<tbody>"; ! while ($emot = ofirst_dbfetch_object($query)) { ! echo "<tr><td>".$emot->substitution."</td><td>".$emot->emoticon."</td></tr>"; ! } ! echo "</tbody>"; ! if ($showfoot) { ! echo "<tfoot><tr><td colspan=\"2\"><a href='$basepath/emoticon/'>Show more...</a></td></tr></tfoot>"; ! } ! echo "</table>"; ! } else { ! echo '<div class="error"><p>A database error occured!</p><pre>'; ! echo '('.$err.') '; ! echo htmlentities(ofirst_dberror()); ! echo '</pre></div>'; ! } ! } ! ! /** Returns an array of emoticons ! * Replacement for above if you want custom display. ! */ ! ! function emoticon_array($limit = 5, $start = 0) { ! global $basepath; ! $query = ofirst_dbquery("SELECT * FROM ofirst_emoticon LIMIT $limit OFFSET $start"); ! $rtn = array(); ! if ($query && ofirst_dberrno() == 0) { ! while ($emot = ofirst_dbfetch_object($query)) { ! $rtn[$emot->emoticon] = $emot->substitution; ! } ! return $rtn; ! } else { ! return false; } } *************** *** 72,74 **** } ! ?> --- 103,105 ---- } ! ?> \ No newline at end of file Index: index.php =================================================================== RCS file: /cvsroot/openfirst/emoticon/index.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** index.php 24 Dec 2003 18:05:50 -0000 1.8 --- index.php 28 Aug 2005 03:43:29 -0000 1.8.2.1 *************** *** 26,45 **** * */ ! include_once("../config/globals.php"); include_once($header); if(function_exists("emoticon_preview")) { ! if(! isset($_GET["perpage"])) { $_GET["perpage"] = 25; } ! if(! isset($_GET["start"])) { $_GET["start"] = 0; } ! echo("<h2>Emoticon Preview</h2><form action='./' method='get'> ! <br>Start at emoticon <input type='text' name='start' value='" . $_GET["start"] ."' size='3'> show ! <input type='text' name='perpage' value='" . $_GET["perpage"] ."' size='3'> emoticons per page. ! <input type='submit' value='Show Emoticons'> </form>"); ! emoticon_preview($_GET["perpage"], $_GET["start"]); ! echo "<br>"; } else { echo("Emoticon functions are not enabled"); } ! include_once($footer); ?> --- 26,48 ---- * */ ! include_once("../includes/globals.php"); include_once($header); if(function_exists("emoticon_preview")) { ! $perpage = 25; ! $start = 0; ! if( isset($_GET["perpage"])) { $perpage = $_GET["perpage"]; } ! if( isset($_GET["start"])) { $start = $_GET["start"]; } ! echo("<h2>Emoticon Preview</h2> ! <form action='".htmlentities($_SERVER['REQUEST_URI'])."' method='get'> ! <p>Start at emoticon <input type='text' name='start' value='" . ($start+$perpage) ."' size='3'><br /> ! show <input type='text' name='perpage' value='" . $perpage ."' size='3'> emoticons per page.</p> ! <p><input type='submit' value='Show Emoticons'></p> </form>"); ! emoticon_preview($perpage, $start, false); } else { echo("Emoticon functions are not enabled"); } ! include_once($footer); ! ?> \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-08-28 03:43:40
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25250/config Modified Files: Tag: REL1_1_BRANCH install.php Log Message: All modules install (under MySQL). Emoticon known to work. -install.php updated to current method -problems with auth.php fixed? (Watch auth.php, it's a tricky one) -ofirst_dbfetch_array() added (Need to port to HEAD) -var name mismatch fixed in globals.php -serious updates to logger (no longer tracks total and pagetotal) -issues with poll removed Index: install.php =================================================================== RCS file: /cvsroot/openfirst/base/config/install.php,v retrieving revision 1.17.2.1 retrieving revision 1.17.2.2 diff -C2 -d -r1.17.2.1 -r1.17.2.2 *** install.php 24 Aug 2005 21:43:05 -0000 1.17.2.1 --- install.php 28 Aug 2005 03:43:29 -0000 1.17.2.2 *************** *** 28,107 **** // Purpose: set up OpenFIRST modules include("../includes/globals.php"); include($header); ! if(isset($user->user) == true && $user->membertype == "administrator") { ?> <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> ! <font color="#FF0000">Once installed, modules must be enabled from the <a href="modules.php"><strong>Module ! Administrator</strong></a>.</font></p> <form method="post" action="install.php"> ! <table> ! <tr><th>Module Name</th><th>Response</th></tr> <?php ! if(function_exists("glob")) { ! foreach (glob("../*/setup/*.$dbasetype") as $filename) { ! $sqlf = str_replace(".", "-", str_replace(".$dbasetype", "",substr(strrchr($filename, "/"), 1))); ! $dir = str_replace(".", "-", str_replace(".$dbasetype", "", substr(strchr($filename, "/"), 1))); ! echo("<tr><td><br /> <input type='checkbox' name='$dir'>$sqlf - $dir</input></td>"); ! if(isset($_POST[$dir]) == true && $_POST[$dir] == "on") { ! ! $q = ofirst_dbquery("CREATE table IF NOT EXISTS `ofirst_config` (`modulename` CHAR(25) NOT NULL, ! `showonmenu` BOOL, `active` BOOL, `adminnavigation` TEXT, ! `modulenavigation` TEXT, `includes` TEXT, PRIMARY KEY (`modulename`));"); ! $sf = fopen($filename, "r"); ! $query = ""; ! while($line = fgets($sf)) { ! if(substr($line, 0, 2) != "--" && substr($line, 0, 1) != "#" && strlen($line) > 0) { ! $q = ofirst_dbquery(trim($line)); ! } ! } ! fclose($sf); ! echo("<td><b><font color='Green'>Module Installed</font></b></td></tr>"); ! }else{ ! echo "<td>--</td></tr>"; ! } ! } ! } else { ! chdir(".."); ! $handle=@opendir(getcwd()); ! while ($file = readdir($handle)){ ! if(is_dir("$file") && $file != "." && $file != "..") { ! $handl=@opendir(getcwd() . "/$file/setup/"); ! while ($fil = @readdir($handl)){ ! if($fil != ".." && $fil != "." && $fil != "" && strpos($fil, $dbasetype) > 0) { ! $filename = "../$file/setup/$fil"; ! $sqlf = str_replace(".", "-", str_replace(".$dbasetype", "",substr(strrchr($filename, "/"), 1))); ! $dir = str_replace(".", "-", str_replace(".$dbasetype", "", substr(strchr($filename, "/"), 1))); ! echo("<br /> <input type='checkbox' name='$dir'>$sqlf - $dir</input>"); ! if(isset($_POST[$dir]) == true && $_POST[$dir] == "on") { ! $q = ofirst_dbquery("CREATE table IF NOT EXISTS `ofirst_config` (`modulename` CHAR(25) NOT NULL, ! `showonmenu` BOOL, `active` BOOL, `adminnavigation` TEXT, ! `modulenavigation` TEXT, `includes` TEXT, PRIMARY KEY (`modulename`));"); ! $filename = "$file/setup/$fil"; ! $sf = fopen($filename, "r"); ! $query = ""; ! while($line = fgets($sf, 4096)) { ! if(substr($line, 0, 2) != "--" && substr($line, 0, 1) != "#" && strlen($line) > 0) { ! $q = ofirst_dbquery(trim($line)); ! } ! } ! echo(" - <b>Submitted, and added.</b>"); ! fclose($sf); ! $filename = "../$file/setup/$fil"; ! } } - } } } } --- 28,112 ---- // Purpose: set up OpenFIRST modules + /* $q = ofirst_dbquery("CREATE table IF NOT EXISTS `ofirst_config` (`modulename` CHAR(25) NOT NULL, + `showonmenu` BOOL, `active` BOOL, `adminnavigation` TEXT, + `modulenavigation` TEXT, `includes` TEXT, PRIMARY KEY (`modulename`));");*/ + include("../includes/globals.php"); include($header); ! if(isset($user->user) && $user->membertype == "administrator") { ?> <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> <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 Name</th><th>Status</th></tr> ! </thead> ! <tbody> <?php ! $InstalledModules = array(); ! $res = ofirst_dbquery('SELECT modulename FROM ofirst_config'); ! while ($row = ofirst_dbfetch_object($res)) { ! $InstalledModules[] = $row->modulename; ! } ! $Modules = array(); ! $files = glob("$fbasepath/*/setup/setup.$dbasetype"); ! 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(); ! } ! # Get the meta data ! foreach($files as $file) { ! $code = basename(dirname(dirname($file))); ! $dir = "$fbasepath/$code"; ! $sqlf = "$dir/setup/setup.$dbasetype"; ! $WasInstalled = $IsInstalled = in_array($code, $InstalledModules); ! $InstallFailed = false; ! if(isset($_POST[$code]) == true && $_POST[$code] == "on" && !$IsInstalled) { ! if (!($error = ofirst_dbexec_file($sqlf))) { ! $IsInstalled = true; ! } else { ! $InstallFailed = true; } } + echo '<tr><td><input type="checkbox" name="'.htmlentities($code).'" '; + if ($IsInstalled) echo 'checked="checked" '; + echo '/><label for="'.htmlentities($code).'">'.htmlentities($code).'</label></td> + <td><!--version goes here--></td> + <td><!--'.htmlentities($code).'--></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! Error:<br /> + '.htmlentities($error).'</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>'; } } |
From: Jamie <ast...@us...> - 2005-08-28 03:43:39
|
Update of /cvsroot/openfirst/poll In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25250/poll Modified Files: Tag: REL1_1_BRANCH poll.php Log Message: All modules install (under MySQL). Emoticon known to work. -install.php updated to current method -problems with auth.php fixed? (Watch auth.php, it's a tricky one) -ofirst_dbfetch_array() added (Need to port to HEAD) -var name mismatch fixed in globals.php -serious updates to logger (no longer tracks total and pagetotal) -issues with poll removed Index: poll.php =================================================================== RCS file: /cvsroot/openfirst/poll/poll.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** poll.php 24 Dec 2003 06:29:43 -0000 1.1 --- poll.php 28 Aug 2005 03:43:29 -0000 1.1.2.1 *************** *** 28,37 **** */ ! include_once("../config/globals.php"); ! ! ?> ! ! ! ! ! --- 28,30 ---- */ ! ?> \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-08-28 03:43:38
|
Update of /cvsroot/openfirst/awards/setup In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25250/awards/setup Modified Files: Tag: REL1_1_BRANCH setup.mysql Log Message: All modules install (under MySQL). Emoticon known to work. -install.php updated to current method -problems with auth.php fixed? (Watch auth.php, it's a tricky one) -ofirst_dbfetch_array() added (Need to port to HEAD) -var name mismatch fixed in globals.php -serious updates to logger (no longer tracks total and pagetotal) -issues with poll removed Index: setup.mysql =================================================================== RCS file: /cvsroot/openfirst/awards/setup/Attic/setup.mysql,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** setup.mysql 14 Feb 2004 14:35:26 -0000 1.8 --- setup.mysql 28 Aug 2005 03:43:28 -0000 1.8.2.1 *************** *** 1,3 **** ! CREATE TABLE `ofirst_awards` (`ID` int(6) unsigned NOT NULL auto_increment, `AwardName` tinytext, `Description` text,`Event` tinytext, `Date` date default NULL, `Recipient` tinytext, `Image` tinytext, PRIMARY KEY (`ID`)) TYPE=MyISAM; ! ALTER TABLE `ofirst_awards` ADD column Description TEXT; ! INSERT INTO ofirst_config SET modulename='awards',showonmenu='0',active='0',adminnavigation='<a href="$basepath/awards/admin/">Manage Awards</a>',modulenavigation='<a href="$basepath/awards/">View Awards</a>'; --- 1,2 ---- ! CREATE TABLE `ofirst_awards` (`ID` int(6) unsigned NOT NULL auto_increment, `AwardName` tinytext, `Description` text,`Event` tinytext, `Date` date default NULL, `Recipient` tinytext, `Image` tinytext, PRIMARY KEY (`ID`)); ! REPLACE INTO ofirst_config SET modulename='awards',showonmenu='0',active='0',adminnavigation='<a href="$basepath/awards/admin/">Manage Awards</a>',modulenavigation='<a href="$basepath/awards/">View Awards</a>'; \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-08-25 01:36:10
|
Update of /cvsroot/openfirst/base/style In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5362/style Modified Files: Tag: REL1_1_BRANCH headers.php Log Message: Fixed installation? Index: headers.php =================================================================== RCS file: /cvsroot/openfirst/base/style/headers.php,v retrieving revision 1.6.2.3 retrieving revision 1.6.2.4 diff -C2 -d -r1.6.2.3 -r1.6.2.4 *** headers.php 24 Aug 2005 23:09:38 -0000 1.6.2.3 --- headers.php 25 Aug 2005 01:36:02 -0000 1.6.2.4 *************** *** 1,136 **** ! <?php ! if(! isset($basepath)){ ! $basepath = "http://openfirst.sourceforge.net/"; ! $title = "openFIRST Team"; ! } ! ?> ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ! <html> ! <head> ! <title><?php echo $title; ?></title> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <meta http-equiv="Content-Language" content="en-CA"> ! <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"> ! <style type="text/css"> ! #adminmenu { color: #ffffff; } ! #adminmenu a:link { color: #ffffff; } ! #adminmenu a:visited { color: #ffffff; } ! #adminmenu a:active { color: #ffffff; } ! #adminmenu a:hover { color: #ffffff; } ! ! a:link { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } ! a:visited { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } ! a:active { color: #0000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } ! a:hover { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } ! ! #topmenu { text-align: left; } ! #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; } ! ! table { border-left:solid #999999 1px;border-right:solid #999999 1px;border-bottom:solid #999999 1px; margin-left:auto; margin-right:auto; } ! 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; text-align: center; margin: 0px; } ! 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('<?php echo("$basepath/images/"); ?>back-light.gif'); } ! td.sub { background-color: #999999; color: #333333;background-image: url('<?php echo("$basepath/images/"); ?>back-lighter.gif'); } ! </style> ! </head> ! <body> ! ! <table width="100%" border="0" cellspacing="0" cellpadding="6"> ! <tr> ! <td> <img src="<?php echo("$basepath/style/images/"); ?>openfirst.png" alt="openFIRST Portal System"> ! </td> ! </tr> ! <tr> ! <th id="topmenu" style="background-image: url('<?php echo($basepath); ?>/style/images/back.gif');"> ! <?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 style="background-image: url('<?php echo("$basepath/style/images/"); ?>back-light.gif'); "> ! <table width="100%" border="0" cellspacing="0" ! cellpadding="0"> ! <tr> ! <td width="63%"> ! <?php ! ! // Check if module name has been set then echo ! if(isset($modulename)){ ! echo "<b>$currentmodulen</b> -"; ! } ! ! // Check if navigation bar option is set then echo options ! if(isset($subnav)){ ! ! // Output module navigation bar ! echo $subnav; ! } ! ?> ! </td> ! <td width="37%"> <div> ! <div align="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!"; ! } ! ! ?> ! </div> ! </div></td> ! </tr> ! </table></td> ! </tr> ! <?php ! ! if (isset($user->user)){ ! if(isset($adminnav) == true && $user->membertype == "administrator"){ ! ! ?> ! <tr> ! <td id="adminmenu" background="<?php echo("$basepath/style/images/"); ?>back-admin.png"><b>Admin Options -</b> ! <?php ! // Print admin navigation bar ! echo $adminnav; ! ?></td> ! </tr> ! <?php ! ! } ! } ! ! ?> ! </table> ! <?php ! ! if ($basepath == "http://openfirst.sourceforge.net/") { ! unset($basepath); ! } ! ! ?> --- 1,129 ---- ! <?php ! if(! isset($basepath)){ ! $basepath = "http://openfirst.sourceforge.net"; ! $ogStylePath = "http://openfirst.sourceforge.net"; ! } ! ?> ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ! <html> ! <head> ! <title><?php echo $title; ?></title> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <meta http-equiv="Content-Language" content="en-CA"> ! <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"> ! <style type="text/css"> ! #adminmenu { color: #ffffff; } ! #adminmenu a:link { color: #ffffff; } ! #adminmenu a:visited { color: #ffffff; } ! #adminmenu a:active { color: #ffffff; } ! #adminmenu a:hover { color: #ffffff; } ! ! a:link { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } ! a:visited { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } ! a:active { color: #0000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } ! a:hover { color: #000000; font-size: 12px; font-family: sans-serif; text-decoration: underline; } ! ! #topmenu { text-align: left; } ! #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; } ! ! table { border-left:solid #999999 1px;border-right:solid #999999 1px;border-bottom:solid #999999 1px; margin-left:auto; margin-right:auto; } ! 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; text-align: center; margin: 0px; } ! 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('<?php echo("$basepath/images/"); ?>back-light.gif'); } ! td.sub { background-color: #999999; color: #333333;background-image: url('<?php echo("$basepath/images/"); ?>back-lighter.gif'); } ! </style> ! </head> ! <body> ! ! <table width="100%" border="0" cellspacing="0" cellpadding="6"> ! <tr> ! <td> <img src="<?php echo("$ogStylePath/images/"); ?>openfirst.png" alt="openFIRST Portal System"> ! </td> ! </tr> ! <tr> ! <th id="topmenu" style="background-image: url('<?php echo($ogStylePath); ?>/images/back.gif');"> ! <?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 style="background-image: url('<?php echo("$ogStylePath/images/"); ?>back-light.gif'); "> ! <table width="100%" border="0" cellspacing="0" ! cellpadding="0"> ! <tr> ! <td width="63%"> ! <?php ! ! // Check if module name has been set then echo ! if(isset($modulename)){ ! echo "<b>$currentmodulen</b> -"; ! } ! ! // Check if navigation bar option is set then echo options ! if(isset($subnav)){ ! ! // Output module navigation bar ! echo $subnav; ! } ! ?> ! </td> ! <td width="37%"> <div> ! <div align="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!"; ! } ! ! ?> ! </div> ! </div></td> ! </tr> ! </table></td> ! </tr> ! <?php ! ! if (isset($user->user)){ ! if(isset($adminnav) == true && $user->membertype == "administrator"){ ! ! ?> ! <tr> ! <td id="adminmenu" background="<?php echo("$ogStylePath/images/"); ?>back-admin.png"><b>Admin Options -</b> ! <?php ! // Print admin navigation bar ! echo $adminnav; ! ?></td> ! </tr> ! <?php ! ! } ! } ! ! ?> ! </table> \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-08-25 01:15:53
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1038/config Modified Files: Tag: REL1_1_BRANCH first.php Log Message: Fixed installation? Index: first.php =================================================================== RCS file: /cvsroot/openfirst/base/config/first.php,v retrieving revision 1.37.2.4 retrieving revision 1.37.2.5 diff -C2 -d -r1.37.2.4 -r1.37.2.5 *** first.php 25 Aug 2005 00:30:17 -0000 1.37.2.4 --- first.php 25 Aug 2005 01:15:44 -0000 1.37.2.5 *************** *** 34,39 **** // Initialize header/footer vars $title = 'openFIRST Installation'; - $stylepath = 'http://openfirst.sourceforge.net/'; - if(isset($_POST["login"])) { --- 34,37 ---- *************** *** 49,52 **** --- 47,51 ---- if(isset($_POST["sqlserver"])) { + echo "Post found\n"; $sqlserver = $_POST["sqlserver"]; $sqluser = $_POST["sqluser"]; *************** *** 54,61 **** $sqldatabase = $_POST["sqldatabase"]; $fbasepath = realpath($_POST['fbasepath']); ! include_once("$fbasepath/includes/globals.php"); #HACK: Change when module installationg code is written ! if (!ofirst_dbcreate()) echo 'DB/tables creation error: '.ofirst_dberror(); --- 53,60 ---- $sqldatabase = $_POST["sqldatabase"]; $fbasepath = realpath($_POST['fbasepath']); ! include_once("$fbasepath/includes/dbase.php"); #HACK: Change when module installationg code is written ! if (!ofirst_dbcreate($sqlserver, $sqluser, $sqlpassword, $sqldatabase)) echo 'DB/tables creation error: '.ofirst_dberror(); *************** *** 71,75 **** // options. $ConfigFile = "$fbasepath/includes/sitesettings.php"; ! if ( (file_exists($ConfigFile) && is_writable($ConfigFile)) || is_writable(dirname($ConfigFile)) ) { $file = file_get_contents('../includes/sitesettings.tpl'); $cookielogins = ((isset($_POST["cookielogins"]) && $_POST["cookielogins"]=="yes") ? true : false); --- 70,76 ---- // options. $ConfigFile = "$fbasepath/includes/sitesettings.php"; ! if ( ( file_exists($ConfigFile) && is_writable($ConfigFile) ) || ! ( !file_exists($ConfigFile) && is_writable(dirname($ConfigFile)) ) ! ) { $file = file_get_contents('../includes/sitesettings.tpl'); $cookielogins = ((isset($_POST["cookielogins"]) && $_POST["cookielogins"]=="yes") ? true : false); *************** *** 117,120 **** --- 118,122 ---- $hfile = fopen("$ConfigFile",'w'); fwrite($hfile, $file); fclose($hfile); + include_once("$fbasepath/includes/globals.php"); include_once($header); echo("<div class=\"success\"><h1>openFIRST Software Configured</h1> *************** *** 144,148 **** // Do form include("../includes/globals.php"); ! include($Header); // Detect default options --- 146,150 ---- // Do form include("../includes/globals.php"); ! include($header); // Detect default options *************** *** 223,227 **** <input type="text" name="sqldatabase" value="openfirst" /> </dd> ! <dt>(I this database does not already exist, the user entered above must have access to create it.</dt> </dl> </fieldset> --- 225,229 ---- <input type="text" name="sqldatabase" value="openfirst" /> </dd> ! <dt>(If this database does not already exist, the user entered above must have access to create it.</dt> </dl> </fieldset> |
From: Jamie <ast...@us...> - 2005-08-25 01:15:51
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1018/includes Modified Files: Tag: REL1_1_BRANCH dbase.php globals.php sitesettings.tpl Log Message: Fixed installation? Index: sitesettings.tpl =================================================================== RCS file: /cvsroot/openfirst/base/includes/sitesettings.tpl,v retrieving revision 1.4.2.2 retrieving revision 1.4.2.3 diff -C2 -d -r1.4.2.2 -r1.4.2.3 *** sitesettings.tpl 25 Aug 2005 00:16:31 -0000 1.4.2.2 --- sitesettings.tpl 25 Aug 2005 01:15:36 -0000 1.4.2.3 *************** *** 26,31 **** $fbasepath = %FBASEPATH%; $home = %HOME%; ! $ogStylePath = "$BasePath/style"; ! $ogFStylePath = "$fBasePath/style"; $header = %HEADER%; $footer = %FOOTER%; --- 26,31 ---- $fbasepath = %FBASEPATH%; $home = %HOME%; ! $ogStylePath = "$basepath/style"; ! $ogFStylePath = "$fbasepath/style"; $header = %HEADER%; $footer = %FOOTER%; Index: dbase.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/dbase.php,v retrieving revision 1.7.2.4 retrieving revision 1.7.2.5 diff -C2 -d -r1.7.2.4 -r1.7.2.5 *** dbase.php 25 Aug 2005 00:16:31 -0000 1.7.2.4 --- dbase.php 25 Aug 2005 01:15:36 -0000 1.7.2.5 *************** *** 295,299 **** function ofirst_dbcreate($sqlserver, $sqluser, $sqlpassword, $sqldatabase) { - trigger_error('Depreciated function called: ofirst_dbcreate()', E_USER_NOTICE); /* Create database if it does not already exist */ ofirst_dbconnect("$sqlserver","$sqluser","$sqlpassword"); --- 295,298 ---- *************** *** 359,364 **** function ofirst_dbexec_file($filename, $linkidentifier = "") { ! if (file_exists($filename) && is_readable($filename)) { ! $sf = fopen($filename, "r"); $query = ""; while($line = fgets($sf)) { --- 358,363 ---- function ofirst_dbexec_file($filename, $linkidentifier = "") { ! if (file_exists($filename) && is_readable($filename) && is_file($filename)) { ! /* $sf = fopen($filename, "r"); $query = ""; while($line = fgets($sf)) { *************** *** 367,374 **** } } ! fclose($sf); ! return true; } else { ! return false; } } --- 366,375 ---- } } ! fclose($sf);*/ ! $line = file_get_contents($filename); ! $q = ofirst_dbquery(trim($line), $linkidentifier); ! return ofirst_dberrno($linkidentifier) ? ofirst_dberror($linkidentifier) : false; } else { ! return "Can't read file"; } } Index: globals.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/globals.php,v retrieving revision 1.14.2.3 retrieving revision 1.14.2.4 diff -C2 -d -r1.14.2.3 -r1.14.2.4 *** globals.php 25 Aug 2005 00:35:11 -0000 1.14.2.3 --- globals.php 25 Aug 2005 01:15:36 -0000 1.14.2.4 *************** *** 29,33 **** $configdir = dirname(__FILE__); ! if( !defined('OPENFIRST_NO_INSTALLATION') && !file_exists( "$configdir/sitesettings.php" ) ) { $path = "#"; if(file_exists("../config/first.php")) { --- 29,33 ---- $configdir = dirname(__FILE__); ! if( !defined('OPENFIRST_INSTALLATION_SCRIPT') && !file_exists( "$configdir/sitesettings.php" ) ) { $path = "#"; if(file_exists("../config/first.php")) { *************** *** 44,50 **** if (defined('OPENFIRST_NO_INSTALLATION')) { if(is_readable("style/headers.php")) { ! $Header = "style/headers.php"; } else { ! $Header = "../style/headers.php"; } } --- 44,50 ---- if (defined('OPENFIRST_NO_INSTALLATION')) { if(is_readable("style/headers.php")) { ! $header = "style/headers.php"; } else { ! $header = "../style/headers.php"; } } *************** *** 55,65 **** 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'); --- 55,65 ---- if (substr(PHP_OS, 0, 3) == 'WIN') { ! $ostype = osWINDOWS; } else { ! $ostype = osUNIX; } #Because of the differences between versions, this may be needed. ! $ogUsingPHP5 = version_compare(PHP_VERSION, '5.0.0', '>='); require_once('compatibility.php'); *************** *** 83,87 **** $sqlTablePrefix = 'ofirst_'; ! if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) require_once('sitesettings.php'); --- 83,87 ---- $sqlTablePrefix = 'ofirst_'; ! if (!defined('OPENFIRST_NO_INSTALLATION')) require_once('sitesettings.php'); *************** *** 110,116 **** } - $headers = ""; if (!defined('OPENFIRST_NO_INSTALLATION')) { ofirst_select_db($sqldatabase, $sqlconnection); $incl = ofirst_dbquery("SELECT * FROM ofirst_config"); --- 110,117 ---- } if (!defined('OPENFIRST_NO_INSTALLATION')) { + $headers = ""; + ofirst_select_db($sqldatabase, $sqlconnection); $incl = ofirst_dbquery("SELECT * FROM ofirst_config"); |
From: Jamie <ast...@us...> - 2005-08-25 00:35:19
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25865/includes Modified Files: Tag: REL1_1_BRANCH globals.php Log Message: Fixed some checks with installation Index: globals.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/globals.php,v retrieving revision 1.14.2.2 retrieving revision 1.14.2.3 diff -C2 -d -r1.14.2.2 -r1.14.2.3 *** globals.php 25 Aug 2005 00:16:31 -0000 1.14.2.2 --- globals.php 25 Aug 2005 00:35:11 -0000 1.14.2.3 *************** *** 106,110 **** // Include the functions using glob(); foreach (glob("$fbasepath/includes/functions/*.php") as $filename) { ! include_once($filename); } } --- 106,110 ---- // Include the functions using glob(); foreach (glob("$fbasepath/includes/functions/*.php") as $filename) { ! // include_once($filename); } } *************** *** 112,115 **** --- 112,116 ---- $headers = ""; + if (!defined('OPENFIRST_NO_INSTALLATION')) { ofirst_select_db($sqldatabase, $sqlconnection); $incl = ofirst_dbquery("SELECT * FROM ofirst_config"); *************** *** 156,160 **** } } ! session_write_close(); ?> \ No newline at end of file --- 157,161 ---- } } ! } session_write_close(); ?> \ No newline at end of file |
From: Jamie <ast...@us...> - 2005-08-25 00:30:26
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24465/config Modified Files: Tag: REL1_1_BRANCH first.php Log Message: syntax error Index: first.php =================================================================== RCS file: /cvsroot/openfirst/base/config/first.php,v retrieving revision 1.37.2.3 retrieving revision 1.37.2.4 diff -C2 -d -r1.37.2.3 -r1.37.2.4 *** first.php 25 Aug 2005 00:16:31 -0000 1.37.2.3 --- first.php 25 Aug 2005 00:30:17 -0000 1.37.2.4 *************** *** 126,130 **** the password for that account has been changed, or the MySQL settings are incorrect.</p>"); showlogin(); ! include_once($footer) die; } else { --- 126,130 ---- the password for that account has been changed, or the MySQL settings are incorrect.</p>"); showlogin(); ! include_once($footer); die; } else { |
From: Jamie <ast...@us...> - 2005-08-25 00:19:58
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21403/includes Removed Files: Tag: REL1_1_BRANCH globals-default.php Log Message: File obsolete. --- globals-default.php DELETED --- |
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20526/includes Modified Files: Tag: REL1_1_BRANCH auth.php dbase.php Added Files: Tag: REL1_1_BRANCH .cvsignore compatibility.php functions.php globals.php sitesettings.tpl Log Message: Updated globals.php, auth.php, and partly dbase.php. Added functions.php and compatibility.php in the process Updated install system. --- NEW FILE: sitesettings.tpl --- <?php /* * openFIRST base configuration file * This file has been automatically generated by first.php. * it contains the basic configuration options required to * operate the OpenFIRST web portal software. Note, that * most configuration options are now stored in the MySQL * database, in the ofirst_config table. */ $dbasetype = %DBTYPE%; $encryption = %ENCRYPT%; $title = %TITLE%; $version = %VER%; $sqlserver = %DBSERVER%; $sqluser = %DBUSER%; $sqlpassword = %DBPASS%; $sqldatabase = %DBNAME%; $pass_save_disabled = %COOKIE%; $regenabled = %REG%; $server = %SERVER%; $basepath = %BASEPATH%; $fbasepath = %FBASEPATH%; $home = %HOME%; $ogStylePath = "$BasePath/style"; $ogFStylePath = "$fBasePath/style"; $header = %HEADER%; $footer = %FOOTER%; $mailnotify = %MASTERMAIL%; $mailfrom = %BOTMAIL%; ?> --- NEW FILE: functions.php --- <?php /* * openFIRST.base - includes/functions.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. * 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 global functions to openFIRST /** Replaces standard vars in config text. * Currently includes $BasePath, $fBasePath, * $StylePath, $fStylePath, $ModPath, and $fModPath. */ function ofReplaceVariables($text, $ModuleDir = false) { if ($ModuleDir === false) { global $CurrentModule; if (is_object($CurrentModule)) $ModuleDir == $CurrentModule->getDir(); } global $BasePath, $fBasePath, $StylePath, $fStylePath; $find = array('$BasePath', '$fBasePath', '$StylePath', '$fStylePath', '$ModPath', '$fModPath', '$DirName' ); $replace = array($BasePath, $fBasePath, $StylePath, $fStylePath, "$BasePath/$ModuleDir", "$fBasePath/$ModuleDir", "$ModuleDir" ); return str_ireplace($find, $replace, $text); } /** Formats the size of computer data. * Uses the units: KB, MB, GB, etc. * Uses 1024 definition (1 KB = 1024 B) */ function ofFormatSize($size) { $base = 1024; $units = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB', 'XB', false, 'VB' ); $units = array_reverse($units, true); reset($units); while (list($pow, $unit) = each($units)) { if ($unit === false) continue; if ($size >= pow($base, $pow)) { $unitsize = $size/pow($base, $pow); $unitsize = rtrim($unitsize, '0'); if (substr($unitsize, -1) == '.') $unitsize = substr($unitsize, 0, -1); return number_format($unitsize, 2, '.', '').' '.$unit; } } } /** Strip line comment. * Given a string and an array of commentors (in PHP, it would be array('#', '//')), * remove all end-of-line comments. * Now handles multiple lines */ function ofStripLineComment($commentors, $text) { $rtn = array(); $lines = explode(array("\r\n","\n","\r"), $text); foreach($lines as $line) { $parts = explode($commentors, $line, 2); $rtn[] = $parts[0]; } return implode(PHP_EOL, $rtn); } /** Converts input to boolean * returns true on: yes, y, true, 1 * returns false on: no, n, false, 0 * returns nothing if neither (return;). * if a value is in both $moretrue and $morefalse, it is treated as true * case-insensitive */ function ofConvert2Bool($text, $moretrue=array(), $morefalse=array()) { $yesvals = $moretrue; $yesvals[] = 'yes'; $yesvals[] = 'y'; $yesvals[] = 'true'; $yesvals[] = '1'; $novals = $morefalse; $novals[] = 'no'; $novals[] = 'n'; $novals[] = 'false'; $novals[] = '0'; foreach ($yesvals as $val) { if (strcasecmp($text, $val) == 0) return true; } foreach ($novals as $val) { if (strcasecmp($text, $val) == 0) return false; } return; } ?> --- NEW FILE: compatibility.php --- <?php /* * openFIRST.base - includes/compatibility.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. * 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: Provides functions and constants not available in certain // versions of PHP. Also die if there are common functions not // available. // We use glob enough that we should either write a substitute or just refuse to work if(!function_exists('glob')) { die('You really should upgrade PHP, seeing as you don\'t even have <a href="http://www.php.net/manual/en/function.glob.php"><code>glob()</code></a>.'); } if (!defined('PATH_SEPARATOR')) { switch ($ostype) { case osWINDOWS: define('PATH_SEPARATOR', ';'); break; case osUNIX: default: define('PATH_SEPARATOR', ':'); break; } } if (!function_exists('set_include_path')) { function set_include_path($new_include_path) { $old = get_include_path(); ini_set('include_path', $new_include_path); return $old; } } if (!function_exists('get_include_path')) { function get_include_path() { return ini_get('include_path'); } } if (!function_exists('restore_include_path')) { function restore_include_path() { ini_restore('include_path'); } } ?> --- NEW FILE: globals.php --- <?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'); if (!defined('OPENFIRST_NO_INSTALLATION')) require_once('dbase.php'); set_include_path( get_include_path().PATH_SEPARATOR."$configdir/".PATH_SEPARATOR."."); unset($configdir); require_once('functions.php'); if (!defined('OPENFIRST_NO_INSTALLATION')) require_once('auth.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_'; if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) require_once('sitesettings.php'); if (!defined('OPENFIRST_NO_INSTALLATION')) { /* $ogDB = new DataBase($DBaseType, $sqlServer, $sqlUser, $sqlPassword); $ogDB->selectDB($sqlDatabase);*/ $sqlconnection = ofirst_dbconnect("$sqlserver","$sqluser","$sqlpassword"); ofirst_select_db($sqldatabase); } if (!defined('OPENFIRST_INSTALLATION_SCRIPT')) InitUser(); // 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); } } $headers = ""; ofirst_select_db($sqldatabase, $sqlconnection); $incl = ofirst_dbquery("SELECT * FROM ofirst_config"); // If there is no error then run the module add feature if(ofirst_dberrno() == 0) { // Begin to loop through modules from the databaes while($module = ofirst_dbfetch_object($incl)) { // Check if the value is try, if it is then run an include if( (bool) $module->active == true) { // Check if there are includes that need to be included if(! $module->includes == ""){ // If the list is not empty then explode the value and put it into inclist $inclist = explode(",",$module->includes); // This is to remove an error that you have if you don't check if there are more then 2 if(count($inclist) >= 2){ // Loop through the inclist and add them according to their paths foreach($inclist As $inc){ include("$fbasepath/$module->modulename/$inc"); } } else { // If there is only 1 include available then use this line to include it instead include("$fbasepath/$module->modulename/$module->includes"); } } // If the module has requested to be shown on the menu then add it if( (bool) $module->showonmenu == true) { // If it is the current module then color the item if ($currentmodule == $module->modulename){ $headers .= " » <font color='red'><u><a class='menu' href='$basepath/$module->modulename'>".ucwords($module->modulename)."</a></u></font> |"; // Declare important variables so that headers can pick them up and preview them $adminnav = str_replace("\$basepath", $basepath, $module->adminnavigation) . " <a href='http://bugzilla.openfirst.org'>Report Bug</a>"; $subnav = str_replace("\$basepath", $basepath, $module->modulenavigation); } else { $headers .= " » <a class='menu' href='$basepath/$module->modulename'>".ucwords($module->modulename)."</a> |"; } } } } } session_write_close(); ?> Index: auth.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/auth.php,v retrieving revision 1.5.2.3 retrieving revision 1.5.2.4 diff -C2 -d -r1.5.2.3 -r1.5.2.4 *** auth.php 24 Aug 2005 22:23:58 -0000 1.5.2.3 --- auth.php 25 Aug 2005 00:16:31 -0000 1.5.2.4 *************** *** 27,31 **** --- 27,38 ---- */ // Purpose: Deal with authorization of users. + /** + * @TODO Change $user to $ogUser + * @TODO Create User class + * @TODO Generalize sessioning & authentication and move into classes. + */ + require_once('dbase.php'); + if(isset($encryption) == false) { $encryption = "crypt"; } *************** *** 33,43 **** // syntax: cryptpassword(password, encryption-type, salt); ! function cryptpassword ($password, $encryption = "md5", $salt="") { // Encrypt passwords using whatever algorithm is preferred. ! if ($encryption == "crc32") { return(crc32($password)); ! } elseif ($encryption == "sha1") { return(sha1($password)); ! } elseif ($encryption == "crypt") { return(crypt($password, $salt)); } else { --- 40,53 ---- // syntax: cryptpassword(password, encryption-type, salt); ! function cryptpassword ($password, $enctype = false, $salt="") { ! global $encryption; ! if ($enctype === false) $enctype = $encryption; ! // 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 { *************** *** 48,51 **** --- 58,62 ---- function logout(){ if(isset($GLOBALS["user"]->user)) { + #FIXME: Bad SQL Handling $q = ofirst_dbquery("UPDATE ofirst_members SET authcode = NULL WHERE user='".$GLOBALS["user"]->user."';"); } *************** *** 86,103 **** } // Determine if the user has already logged in with this session. If // they have, set variables indicating this. If they have not, make a // note of this so that components requiring them to log in are disabled. ! if((isset($_SESSION['authcode']))||(isset($_COOKIE["openFIRSTlogin"])&&!isset($pass_save_disabled))) { ! if(isset($_SESSION['authcode'])){ $authcode = $_SESSION['authcode']; ! }elseif(isset($_COOKIE["openFIRSTlogin"])&&$_COOKIE["openFIRSTlogin"]!=0){ $authcode = $_COOKIE["openFIRSTlogin"]; ! $_SESSION['authcode']=$authcode; //renew cookie ! setcookie("openFIRSTlogin",$authcode,time()+2592000,"/"); } else { ! $authcode=0; } $query = ofirst_dbquery("SELECT * FROM ofirst_members WHERE authcode='$authcode';"); if(ofirst_dberrno() == 0 && ofirst_dbnum_rows($query) == 1 && $authcode!=0 ) { --- 97,122 ---- } + function InitUser() { + global $pass_save_disabled, $encryption, $user; // Determine if the user has already logged in with this session. If // they have, set variables indicating this. If they have not, make a // note of this so that components requiring them to log in are disabled. ! ! if ( (isset($_SESSION['authcode'])) || ! (isset($_COOKIE["openFIRSTlogin"]) && !$pass_save_disabled) ! ) { ! ! if (isset($_SESSION['authcode'])) { $authcode = $_SESSION['authcode']; ! } else if (isset($_COOKIE["openFIRSTlogin"]) && $_COOKIE["openFIRSTlogin"] != 0) { $authcode = $_COOKIE["openFIRSTlogin"]; ! $_SESSION['authcode'] = $authcode; //renew cookie ! setcookie("openFIRSTlogin", $authcode, time()+2592000, "/"); } else { ! $authcode = 0; } + + #FIXME: Bad SQL handling $query = ofirst_dbquery("SELECT * FROM ofirst_members WHERE authcode='$authcode';"); if(ofirst_dberrno() == 0 && ofirst_dbnum_rows($query) == 1 && $authcode!=0 ) { *************** *** 110,113 **** --- 129,133 ---- } if(isset($_POST["login"])){ + #FIXME: Bad SQL handling $query = ofirst_dbquery("SELECT * FROM ofirst_members WHERE user='" . $_POST["login"] . "';"); if(ofirst_dberrno() == 0) { *************** *** 128,131 **** --- 148,152 ---- } elseif( isset($_POST["login"]) && isset($_POST["password"]) ) { + #FIXME: Bad SQL handling $query = ofirst_dbquery("SELECT * FROM ofirst_members WHERE user='" . $_POST["login"] . "';"); if(ofirst_dberrno() == 0) { *************** *** 148,212 **** } } else { ! echo "Passwords don't match"; unset($user); } } ! } else echo "DB Error: ".ofirst_dberror(); ! } ! ! ! if(ofirst_dberrno() != 0) { ! // There was an error, check if it's because they didn't create the ! // members table. ! if(ofirst_dberrno() == 1146) { ! echo("<p>Members table does not exist, therefore I am creating it.</p>"); ! $query = ofirst_dbquery("CREATE TABLE ofirst_members ( ! UNIQUE(user), ! user CHAR(128), ! firstname TINYTEXT, ! lastname TINYTEXT, ! lastseen TINYTEXT, ! ip TINYTEXT, ! password TEXT, ! authcode TEXT, ! membertype TINYTEXT, ! division TINYTEXT, ! year INTEGER, ! email TEXT, ! icq INTEGER, ! aim TINYTEXT, ! msn TINYTEXT, ! yim TINYTEXT, ! description TEXT, ! signature TINYTEXT, ! dateregistered TINYTEXT, ! picturelocation TINYTEXT, ! team INTEGER, ! skills TEXT ! );"); ! if(ofirst_dberrno() == 0) { ! // Insert a default user 'administrator' and set them to have ! // administrative access and some password. ! ! $query = ofirst_dbquery("INSERT INTO ofirst_members (user, ! membertype, password) VALUES('admin', 'administrator', '" . ! cryptpassword("openfirst", $encryption) ."');"); ! echo("<p>Members table has been created. Please login as <b>admin</b> using the password <b>openfirst</b> to set configuration options.</p>"); ! showlogin(); ! die(); ! } else { ! die(ofirst_dberror()); ! } } } if(isset($user->user)){ $query = "UPDATE ofirst_members SET lastseen='" . date("h:i:s M d, Y") . "' WHERE user='$user->user';"; ! $q = ofirst_dbquery($query); ! unset($q); } ! ! /* This is here for legacy reasons, so as to make previous versions ! * of certain modules function with the newer base modules. ! */ ! function membersmenu() { return(0); } ! ?> --- 169,187 ---- } } else { ! # invalid password! unset($user); } } ! } else { ! # invalid user! ! unset($user); } } + if(isset($user->user)){ + #FIXME: Bad SQL handling $query = "UPDATE ofirst_members SET lastseen='" . date("h:i:s M d, Y") . "' WHERE user='$user->user';"; ! ofirst_dbquery($query); } ! } ! ?> \ No newline at end of file Index: dbase.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/dbase.php,v retrieving revision 1.7.2.3 retrieving revision 1.7.2.4 diff -C2 -d -r1.7.2.3 -r1.7.2.4 *** dbase.php 24 Aug 2005 22:23:58 -0000 1.7.2.3 --- dbase.php 25 Aug 2005 00:16:31 -0000 1.7.2.4 *************** *** 227,229 **** --- 227,451 ---- exit(0); } + + function ofirst_dbfree_result($resource) { + global $DBaseType; + if($DBaseType == "mysql") { + if(function_exists("mysql_free_result") == false) { + die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); + } + if (!is_resource($resource)) return false; + return mysql_free_result($resource); + } elseif($DBaseType == "mssql") { + if(function_exists("mssql_free_result") == false) { + die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); + } + if (!is_resource($resource)) return false; + return mssql_free_result($resource); + } elseif($DBaseType == "odbc") { + if(function_exists("odbc_free_result") == false) { + die("ODBC support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type."); + } + if (!is_resource($resource)) return false; + return odbc_free_result($resource); + } + exit(0); + } + function ofirst_dbname_version() { + global $DBaseType; + if($DBaseType == "mysql") { + $v = ofirst_dbfetch_object(ofirst_dbquery("SELECT VERSION() AS mysql_version")); + return "MySQL $v->mysql_version"; + } elseif($DBaseType == "mssql") { + $v = ofirst_dbquery("SELECT @@VERSION"); + return "Microsoft SQL Server $v <br><strong>Warning:</strong> unconfirmed"; + } elseif($DBaseType == "odbc") { + return "ODBC"; + } else { + return "Unknown DB type"; + } + } + + function ofirst_dbsize() { + global $DBaseType, $sqlDatabase; + if($DBaseType == "mysql") { + $dbsize = 0; + $dq = ofirst_dbquery("SHOW TABLE STATUS FROM $sqlDatabase"); + while($d = ofirst_dbfetch_object($dq)) { + $dbsize += $d->Data_length + $d->Index_length; + } + return (int) (($dbsize + 0.5) / 1024 * 10) / 10 . " KB"; + } elseif($DBaseType == "mssql") { + $s = ofirst_dbfetch_object(ofirst_dbquery("SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize FROM sysfiles")); + return (int) (( $s->dbsize + 0.5) / 1024 * 10) / 10 . " KB"; + } else { + return "Size not supported"; + } + } + + # Check if there the connection is valid + function ofirst_dbcheck($linkidentifier = "") { + #TODO: Write me! + global $DBaseType; + if($DBaseType == "mysql") { + } elseif($DBaseType == "mssql") { + } elseif($DBaseType == "odbc") { + } + exit(0); + } + + function ofirst_dbcreate($sqlserver, $sqluser, $sqlpassword, $sqldatabase) { + trigger_error('Depreciated function called: ofirst_dbcreate()', E_USER_NOTICE); + /* Create database if it does not already exist */ + ofirst_dbconnect("$sqlserver","$sqluser","$sqlpassword"); + + ofirst_dbquery("CREATE DATABASE IF NOT EXISTS $sqldatabase;"); + if (ofirst_dberror() != 0) return false; + + ofirst_select_db($sqldatabase); + + ofirst_dbquery("CREATE TABLE `ofirst_config` ( + `modulename` varchar(25) NOT NULL default '', + `label` VARCHAR(25), + `version` VARCHAR(10) NOT NULL default 'CVS', + `showonmenu` TINYINT( 1 ) NOT NULL DEFAULT '0', + `active` TINYINT( 1 ) NOT NULL DEFAULT '0', + `adminnavigation` text, + `modulenavigation` text, + `includes` text, + PRIMARY KEY (`modulename`), + UNIQUE (`modulename`) + )"); + if (ofirst_dberror() != 0) return false; + + /* copied from auth.php */ + ofirst_dbquery("CREATE TABLE ofirst_members ( + UNIQUE(user), + user CHAR(128), + firstname TINYTEXT, + lastname TINYTEXT, + lastseen TINYTEXT, + ip TINYTEXT, + password TEXT, + authcode TEXT, + membertype TINYTEXT, + division TINYTEXT, + year INTEGER, + email TEXT, + icq INTEGER, + aim TINYTEXT, + msn TINYTEXT, + yim TINYTEXT, + description TEXT, + signature TINYTEXT, + dateregistered TINYTEXT, + picturelocation TINYTEXT, + team INTEGER, + skills TEXT + );"); + if (ofirst_dberror() != 0) return false; + + if (ofirst_dberrno() == 0) { + // Insert a default user 'administrator' and set them to have + // administrative access and some password. + + ofirst_dbquery("INSERT INTO ofirst_members (user, + membertype, password) VALUES('admin', 'administrator', '" . + cryptpassword("openfirst") ."');"); + if (ofirst_dberror() != 0) return false; + } + /* End copy */ + return true; + } + + function ofirst_dbexec_file($filename, $linkidentifier = "") { + if (file_exists($filename) && is_readable($filename)) { + $sf = fopen($filename, "r"); + $query = ""; + while($line = fgets($sf)) { + if(substr($line, 0, 2) != "--" && substr($line, 0, 1) != "#" && strlen($line) > 0) { + $q = ofirst_dbquery(trim($line)); + } + } + fclose($sf); + return true; + } else { + return false; + } + } + + function ofirst_dbescape($text) { + global $DBaseType; + if($DBaseType == "mysql") { + return mysql_real_escape_string($text); + # MS SQL and ODBC don't have specific escaping functions. + } else { + # Lets just assume there isn't an escaping function + return addslashes($text); + } + exit(0); + } + + /** SQL escaping and quoting. + * These functions escape various kinds of literals. + * If an array is passed, it is assumed to be a list + * of things to be passed and is merged. + */ + + #Used for quoting field and DB names + function ofirst_dbquote_name($name, $delimiter = ',') { + if (is_array($name)) { + $value = ''; + foreach ($name as $text) { + $value .= ofirst_dbquote_name($text).$delimiter; + } + $value = substr($value, 0, -strlen($delimiter)); + return $value; + } else { + return '`'.ofirst_dbescape($name).'`'; + } + } + + #Used for quoting table names. Includes table prefix. + function ofirst_dbquote_table($name, $delimiter = ',') { + global $sqlTablePrefix; + if (is_array($name)) { + $value = ''; + foreach ($name as $text) { + $value .= ofirst_dbquote_table($text).$delimiter; + } + $value = substr($value, 0, -strlen($delimiter)); + return $value; + } else { + return ofirst_dbquote_name("$sqlTablePrefix$name"); + } + } + + #Used for quoting data + function ofirst_dbquote_data($data, $delimiter = ',') { + if (is_array($data)) { + $value = ''; + foreach ($data as $text) { + $value .= ofirst_dbquote_data($text).$delimiter; + } + $value = substr($value, 0, -strlen($delimiter)); + return $value; + } else { + return "'".ofirst_dbescape($data)."'"; + } + } + + #Used to quote field-data pairs in the form of `field`='data' + #passed like: + # array( 'field' => 'data' ) + function ofirst_dbquote_fd_pairs($pairs, $delimiter = ',') { + $value = ''; + foreach ($pairs as $field => $data) { + $value .= ofirst_dbquote_name($field); + $value .= '='; + $value .= ofirst_dbquote_data($data); + $value .= $delimiter; + } + $value = substr($value, 0, -strlen($delimiter)); + return $value; + } ?> --- NEW FILE: .cvsignore --- sitesettings.php |
From: Jamie <ast...@us...> - 2005-08-25 00:16:42
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20526/config Modified Files: Tag: REL1_1_BRANCH first.php Log Message: Updated globals.php, auth.php, and partly dbase.php. Added functions.php and compatibility.php in the process Updated install system. Index: first.php =================================================================== RCS file: /cvsroot/openfirst/base/config/first.php,v retrieving revision 1.37.2.2 retrieving revision 1.37.2.3 diff -C2 -d -r1.37.2.2 -r1.37.2.3 *** first.php 24 Aug 2005 21:51:07 -0000 1.37.2.2 --- first.php 25 Aug 2005 00:16:31 -0000 1.37.2.3 *************** *** 1,393 **** ! <?php ! /* ! * openFIRST.base - config/first.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 the initial set up that must occur once the openFIRST ! // base system has been extracted. This file should be removed once ! // this task is complete, or the permissions on globals.php should be ! // changed to prevent unwanted modification of configuration options. ! ! if(isset($_POST["login"])) { ! // User is attempting to login for the first time. ! 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>"); ! } ! ! if(isset($_POST["ostype"])) { ! include_once("../includes/dbase.php"); ! $sqlserver = $_POST["sqlserver"]; ! $sqluser = $_POST["sqluser"]; ! $sqlpassword = $_POST["sqlpassword"]; ! $sqldatabase = $_POST["sqldatabase"]; ! if(function_exists("ofirst_dbconnect") == false) { ! die("Your version of PHP has not been compiled with MySQL support, therefore the openFIRST web portal system cannot run on this system. Please contact your system administrator to request MySQL support for your version of PHP."); ! } ! $sqlconnection = ofirst_dbconnect("$sqlserver","$sqluser","$sqlpassword"); ! ! /* Create database if it does not already exist */ ! ofirst_dbquery("CREATE DATABASE IF NOT EXISTS $sqldatabase;"); ! ! ofirst_select_db($sqldatabase); ! ! // They have submitted the form, write a new globals.php file and test ! // options. ! if(is_writable("../includes/globals.php")) { ! $of = fopen("../includes/globals.php", "w"); ! if(isset($_POST["cookielogins"])&&$_POST["cookielogins"]=="yes"){ ! $cookielogins=""; ! }else{ ! $cookielogins='$pass_save_disabled=true;'; ! } ! if(isset($_POST["allowreg"])&&$_POST["allowreg"]=="yes"){ ! $allowreg='$regenabled=true;'; ! }else{ ! $allowreg='$regenabled=false;'; ! } ! ! ! fputs($of, "<?php ! /* ! * penFIRST base configuration file ! * This file has been automatically generated by first.php. ! * it contains the basic configuration options required to ! * operate the OpenFIRST web portal software. Note, that ! * most configuration options are now stored in the MySQL ! * database, in the ofirst_config table. ! */ ! \$dbasetype = \"" . $_POST["dbasetype"] . "\"; ! \$ostype = '" . $_POST["ostype"] . "'; ! if (\$ostype == \"windows\") { ! ini_set(\"include_path\", ini_get(\"include_path\") . \"../config/;.\"); ! include_once('dbase.php'); ! } else { ! ini_set(\"include_path\", ini_get(\"include_path\") . \"../config/:.\"); ! include_once('dbase.php'); ! } ! ! \$encryption = '" . $_POST["encryption"] . "'; ! ! \$title = '" . $_POST["title"] . "'; ! \$version = '" . $_POST["version"] . "'; ! \$sqlserver = '" . $_POST["sqlserver"] . "'; ! \$sqluser = '" . $_POST["sqluser"] . "'; ! \$sqlpassword = '" . $_POST["sqlpassword"] . "'; ! \$sqldatabase = '" . $_POST["sqldatabase"] . "'; ! if(function_exists(\"ofirst_dbconnect\") == false) { ! die(\"Your version of PHP has not been compiled with MySQL support, therefore the openFIRST web portal system cannot run on this system. Please contact your system administrator to request MySQL support for your version of PHP.\"); ! } ! ! \$sqlconnection = ofirst_dbconnect(\"\$sqlserver\",\"\$sqluser\",\"\$sqlpassword\"); ! ! ofirst_select_db(\$sqldatabase); ! ! $cookielogins ! $allowreg ! \$home = '" . $_POST["home"] . "'; ! \$header = '" . $_POST["header"] . "'; ! \$footer = '" . $_POST["footer"] . "'; ! \$mailnotify = '" . $_POST["mailnotify"] . "'; ! \$mailfrom = '" . $_POST["mailfrom"] . "'; ! \$basepath = '" . $_POST["basepath"] . "'; ! \$fbasepath = '" . $_POST["fbasepath"] . "'; ! ! // Determine what module the user is viewing ! ! \$currentmodule = str_replace(\$basepath, \"\", \$_SERVER[\"SCRIPT_NAME\"]); ! \$currentmodule = substr(\$currentmodule, 1, strpos(\$currentmodule, \"/\", 2) - 1); ! ! ! session_start(); ! include('auth.php'); ! if(function_exists(\"glob\")) { ! // Include the functions using glob(); ! if(is_readable(getcwd() . \"/../config/functions/\")) { ! foreach (glob(getcwd() . \"/../config/functions/*.php\") as \$filename) { ! include(\$filename); ! } ! } elseif (is_readable(getcwd() . \"/../../config/functions/\")) { ! foreach (glob(getcwd() . \"/../../config/functions/*.php\") as \$filename) { ! include(\$filename); ! } ! } ! } else { ! // Include the functions without using glob(); ! } ! ! \$headers = \"\"; ! ! ofirst_select_db(\$sqldatabase, \$sqlconnection); ! \$incl = ofirst_dbquery(\"SELECT * FROM ofirst_config\"); ! ! // If there is no error then run the module add feature ! if(ofirst_dberrno() == 0) { ! // Begin to loop through modules from the databaes ! while(\$module = ofirst_dbfetch_object(\$incl)) { ! // Check if the value is try, if it is then run an include ! if( (bool) \$module->active == true) { ! // Check if there are includes that need to be included ! if(! \$module->includes == \"\"){ ! // If the list is not empty then explode the value and put it into inclist ! \$inclist = explode(\",\",\$module->includes); ! // This is to remove an error that you have if you don't check if there are more then 2 ! if(count(\$inclist) >= 2){ ! ! // Loop through the inclist and add them according to their paths ! foreach(\$inclist As \$inc){ ! include(\"\$fbasepath/\$module->modulename/\$inc\"); ! } ! } else { ! // If there is only 1 include available then use this line to include it instead ! include(\"\$fbasepath/\$module->modulename/\$module->includes\"); ! } ! } ! ! // If the module has requested to be shown on the menu then add it ! if( (bool) \$module->showonmenu == true) { ! // If it is the current module then color the item ! if (\$currentmodule == \$module->modulename){ ! \$headers .= \" » <font color='red'><u><a class='menu' href='\$basepath/\$module->modulename'>\".ucwords(\$module->modulename).\"</a></u></font> |\"; ! ! // Declare important variables so that headers can pick them up and preview them ! ! \$adminnav = str_replace(\"\\\$basepath\", \$basepath, \$module->adminnavigation) . \" <a href='http://bugzilla.openfirst.org'>Report Bug</a>\"; ! \$subnav = str_replace(\"\\\$basepath\", \$basepath, \$module->modulenavigation); ! ! } else { ! \$headers .= \" » <a class='menu' href='\$basepath/\$module->modulename'>\".ucwords(\$module->modulename).\"</a> |\"; ! } ! } ! } ! } ! } ! ! session_write_close(); ! ?>"); ! fclose($of); ! include("../includes/globals.php"); ! include("$header"); ! echo("<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 <b>globals.php</b> to prevent unwanted changes to the configuration ! options. You should be able to login below using the username <b>admin</b> and the password ! <b>openfirst</b>, if not, then either the password for that account has been changed, or the ! MySQL settings are incorrect.</p>"); ! showlogin(); ! die(include("$footer")); ! } else { ! if(is_readable("style/headers.php")) { ! include("style/headers.php"); ! } else { ! include("../style/headers.php"); ! } ! echo("<h1>System Configuration Error</h1> ! <p>Cannot write to configuration file. Please check permissions on <b>globals.php</b> and ! ensure that the web user has the ability to write to this file.</p> ! ! <p>For unix, this would typically require the command: ! <br /> ! <code> ! cd config ! <br />chmod 666 globals.php ! </code></p>"); ! } ! } else { ! if(is_readable("style/headers.php")) { ! include("style/headers.php"); ! } else { ! include("../style/headers.php"); ! } ! // User is visiting the configuration page, present them with a form ! // of options to fill out. ! ?> ! <h1>Base Configuration</h1> ! <p><form action="<?php echo($_SERVER["PHP_SELF"]); ?>" method="post"> ! Congratulations on your choice of openFIRST software. Please proceed through ! this setup wizard to get your new openFIRST portal software set up and working ! quickly and painlessly. Also please make sure that before installing this script ! that you have the appropriate permissions set on config/globals.php (if not ! then you may receive a collection of errors after submitting this form).<br> ! <br> ! <table width="608"> ! <tr> ! <th width="390">Option</th> ! <th width="206">Value</th> ! </tr> ! <tr> ! <td class="sub"><div align="center">Database Setup</div></td> ! <td class="sub"> </td> ! </tr> ! <tr> ! <td>Operating System of Web Server</td> ! <td><select name="ostype"> ! <?php ! if (isset($_ENV["OS"]) && strpos(" " . $_ENV["OS"], "Windows")) { ! echo("<option value='unix'>UNIX</option> ! <option value='windows' selected='selected'>Windows</option>"); ! } else { ! echo("<option value='unix' selected='selected'>UNIX</option> ! <option value='windows'>Windows</option>"); ! } ! ?> ! </select> <font size="2">(UNIX includes variants, such as Linux, Mac OS ! X, and BeOS) </font></td> ! </tr> ! <tr> ! <td>Database Type</td> ! <td> ! <input type='hidden' name='peardb' value='false'> ! <select name="dbasetype"> ! <option value="mysql" selected="selected">MySQL</option> ! <option value="mssql">Microsoft SQL</option> ! <option value="odbc">ODBC</option> ! </select> ! <tr> ! <td>Title of Website</td> ! <td><input type="text" name="title" value="openFIRST" /></td> ! </tr> ! <tr> ! <td>Version of Website</td> ! <td><input type="text" name="version" value="1.0" /></td> ! </tr> ! <tr> ! <td>Database Server Address</td> ! <td><input type="text" name="sqlserver" value="<?php ! if(ini_get("mysql.default_host") != "") { ! echo(ini_get("mysql.default_host")); ! } else { ! echo("localhost"); ! }?>" /></td> ! </tr> ! <tr> ! <td>Database User Name</td> ! <td><input type="text" name="sqluser" value="<?php ! if(ini_get("mysql.default_user") != "") { ! echo(ini_get("mysql.default_user")); ! } else { ! echo("sqluser"); ! }?>" /></td> ! </tr> ! <tr> ! <td>Database User Password</td> ! <td><input type="password" name="sqlpassword" value="<?php ! if(ini_get("mysql.default_password") != "") { ! echo(ini_get("mysql.default_password")); ! }?>" /></td> ! </tr> ! <tr> ! <td>Database Name<br> <font size="1">(if this database does not already exist, the user entered above ! must have access to create it)</font></td> ! <td><input type="text" name="sqldatabase" value="openfirst" /></td> ! </tr> ! <tr> ! <td class="sub"><div align="center">Linking Options</div></td> ! <td class="sub"> </td> ! </tr> ! <tr> ! <td>Home Site<br> <font size="1">(the address scripts will use for linking ! to your main page) <em>Note:</em> Do not place a backslash after the link ! ie. http://www.yoursite.com</font></td> ! <td> <input type="text" name="home"></td> ! </tr> ! <tr> ! <td>Header file<br> <font size="1">(this should be a full system path) ie. ! c:\inetpub\wwwroot\openfirst\config\header.php or /home/site/public_html/openfirst/config/headers.php</font></td> ! <td><input type="text" name="header" value="<?php echo(getcwd()); ?>/headers.php" /></td> ! </tr> ! <tr> ! <td>Footer file<br> <font size="1">(this should be a full system path) ie. ! c:\inetpub\wwwroot\openfirst\config\footers.php or /home/site/public_html/openfirst/config/footers.php</font></td> ! <td><input type="text" name="footer" value="<?php echo(getcwd()); ?>/footers.php" /></td> ! </tr> ! <tr> ! <td>The base path to the openFIRST software<br> <font size="1">ie. example: ! http://openfirst.sourceforge.net<strong>/openfirst</strong>) this should ! always have a beginning slash but no ending slash.</font></td> ! <td><input type="text" name="basepath" ! value="/openfirst"></td> ! </tr> ! <tr> ! <td>The file system path to the basepath<br> <font size="1">(example: <strong>/home/openfirst/htdocs/openfirst</strong> ! or c:\inetpub\wwwroot\openfirst) this should not have a ending slash.</font></td> ! <td><input type="text" name="fbasepath" value="<?php chdir(".."); echo getcwd(); ?>"></td> ! </tr> ! <tr> ! <td class="sub"><div align="center">Security Options</div></td> ! <td class="sub"> </td> ! </tr> ! <tr> ! <td>Type of encryption to use on database passwords?<br> ! <font size="1">If you are migrating from an existing system, this should be the same encryption ! style that system uses, otherwise all users will have to reset their password; otherwise, in ! most cases the default option is fine.</font></td> ! <td> ! <select name="encryption"> ! <option value='md5' selected='selected'>MD5 Message-Digest Algorithm</option> ! <option value='crypt'>Standard Unix DES-based encryption algorthm</option> ! <option value='crc32'>crc32 Polynomial</option> ! <option value='sha1'>US Secure Hash Algorithm 1 (sha1)</option> ! </select> ! </td></tr> ! <td>Allow openFIRST users to save their passwords?<br> <font size="1">This feature uses cookies to ! automatically log in users into the openFIRST portal.</font></td> ! <td><input type="checkbox" name="cookielogins" id="cookielogins" value="yes" checked> ! <label for="cookielogins">Allowed</label></td> ! </tr> ! <tr> ! <td>Allow users to register on the portal?<br> <font size="1">Enabling this option will ! allow users to register on the website and log in to access the members area. Be careful when ! using this option.</font></td> ! <td><input type="checkbox" name="allowreg" id="allowreg" value="yes"> ! <label for="allowreg">Allowed</label></td> ! </tr> ! <tr> ! <td class="sub"><div align="center">Mailing Options</div></td> ! <td class="sub"> </td> ! </tr> ! <tr> ! <td>Mail Notification<br> <font size="1">(the e-mail address used to notify ! you when significant events occur)</font></td> ! <td><input type="text" name="mailnotify" value="nobody@localhost"></td> ! </tr> ! <tr> ! <td>Mail From<br> <font size="1">(the e-mail address that mail from the ! openFIRST site should appear to be from)</font></td> ! <td><input type="text" name="mailfrom" value="no...@op..."></td> ! </tr> ! <tr> ! <td></td> ! <td><input type="submit" value="Set up OpenFIRST"></td> ! </tr> ! </table> ! </form> ! <?php ! } ! if(is_readable("style/footers.php")) { ! include("style/footers.php"); ! } else { ! include("../style/footers.php"); ! } ! ?> --- 1,330 ---- ! <?php ! /* ! * openFIRST.base - config/first.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 the initial set up that must occur once the openFIRST ! // base system has been extracted. This file should be removed once ! // this task is complete, or the permissions on globals.php should be ! // changed to prevent unwanted modification of configuration options. ! ! // 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 ! ! if(isset($_POST["sqlserver"])) { ! $sqlserver = $_POST["sqlserver"]; ! $sqluser = $_POST["sqluser"]; ! $sqlpassword = $_POST["sqlpassword"]; ! $sqldatabase = $_POST["sqldatabase"]; ! $fbasepath = realpath($_POST['fbasepath']); ! include_once("$fbasepath/includes/globals.php"); ! ! #HACK: Change when module installationg code is written ! if (!ofirst_dbcreate()) ! echo 'DB/tables creation error: '.ofirst_dberror(); ! ! function GetVarValue($var) { ! ob_Start(); ! var_export($var); ! $Value = ob_Get_Contents(); ! ob_End_Clean(); ! return $Value; ! } ! ! // They have submitted the form, write a new globals.php file and test ! // options. ! $ConfigFile = "$fbasepath/includes/sitesettings.php"; ! if ( (file_exists($ConfigFile) && is_writable($ConfigFile)) || is_writable(dirname($ConfigFile)) ) { ! $file = file_get_contents('../includes/sitesettings.tpl'); ! $cookielogins = ((isset($_POST["cookielogins"]) && $_POST["cookielogins"]=="yes") ? true : false); ! $allowreg = ((isset($_POST["allowreg"]) && $_POST["allowreg"]=="yes") ? true : false); ! ! $find = array('%DBTYPE%', ! '%ENCRYPT%', ! '%TITLE%', ! '%VER%', ! '%DBSERVER%', ! '%DBUSER%', ! '%DBPASS%', ! '%DBNAME%', ! '%COOKIE%', ! '%REG%', ! '%HOME%', ! '%HEADER%', ! '%FOOTER%', ! '%MASTERMAIL%', ! '%BOTMAIL%', ! '%SERVER%', ! '%BASEPATH%', ! '%FBASEPATH%'); ! ! $replace = array(GetVarValue($_POST['dbasetype']), ! GetVarValue($_POST['encryption']), ! GetVarValue($_POST['title']), ! GetVarValue($_POST['version']), ! GetVarValue($_POST['sqlserver']), ! GetVarValue($_POST['sqluser']), ! GetVarValue($_POST['sqlpassword']), ! GetVarValue($_POST['sqldatabase']), ! GetVarValue($cookielogins), ! GetVarValue($allowreg), ! GetVarValue($_POST['home']), ! GetVarValue($_POST['header']), ! GetVarValue($_POST['footer']), ! GetVarValue($_POST['mailnotify']), ! GetVarValue($_POST['mailfrom']), ! GetVarValue($_POST['server']), ! GetVarValue($_POST['basepath']), ! GetVarValue($fbasepath)); ! ! $file = str_replace($find, $replace, $file); ! $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 { ! /* echo '<p class="error"><span class="file">'.htmlentities($ConfigFile).'</span> is not writable</p> ! ';*/ ! include_once($header); ! echo("<h1 class=\"error\">System Configuration Error</h1> ! <p>Cannot write to configuration file. Please check permissions on <b>".htmlentities(basename($ConfigFile))."</b> and ! ensure that the web user has the ability to write to this file.</p> ! ! <p>For unix, this would typically require the command: ! <pre class=\"shell\">cd includes<br /> ! chmod 666 \"".htmlentities(addslashes(basename($ConfigFile)))."\"</pre></p>"); ! } ! } else { ! define('OPENFIRST_NO_INSTALLATION', true); ! // Do form ! include("../includes/globals.php"); ! include($Header); ! ! // Detect default options ! $basepath = substr($_SERVER["SCRIPT_NAME"], 0, -17); ! $server = $_SERVER["SERVER_NAME"]; ! $fbasepath = realpath(dirname(__FILE__).'/..'); ! $ConfigFile = "$fbasepath/includes/sitesettings.php"; ! ! $sqlhost = 'localhost'; ! if(ini_get('mysql.default_host') != '') { ! $sqlhost = ini_get('mysql.default_host'); ! } ! ! $sqluser = 'sqluser'; ! if(ini_get('mysql.default_user') != '') { ! $sqluser = ini_get('mysql.default_user'); ! } ! ! $sqlpass = ''; ! if(ini_get('mysql.default_password') != '') { ! $sqlpass = ini_get('mysql.default_password'); ! } ! ! $mailto = $_SERVER['SERVER_ADMIN']; ! $mailfrom = "openfirst@$server"; ! ! // User is visiting the configuration page, present them with a form ! // of options to fill out. ! ?> ! <div class="center"> ! <h1>Base Configuration</h1> ! <p class="center" style="max-width: 50em;">Congratulations for choosing openFIRST! Please proceed through ! this setup wizard to get your new openFIRST portal software set up and working ! quickly and painlessly. Also please make sure that before installing this script ! that you have the appropriate permissions set on <span class="file"><?php echo htmlentities($ConfigFile) ?></span> (if not ! then you may receive a collection of errors after submitting this form).</p> ! </div> ! <form action="<?php echo htmlentities("http://$server$basepath/config/first.php"); ?>" method="post"> ! <fieldset> ! <legend>Database Setup</legend> ! <dl class="setup"> ! <dd> ! <label for="dbasetype">Database Type</label> ! <select name="dbasetype"> ! <option value="mysql" selected="selected">MySQL</option> ! <option value="mssql">Microsoft SQL</option> ! <option value="odbc">ODBC</option> ! </select> ! </dd> ! <dt></dt> ! <dd> ! <label for="title">Title of Website</label> ! <input type="text" name="title" value="openFIRST" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="version">Version of Website</label> ! <input type="text" name="version" value="1.0" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="sqlserver">Database Server Address</label> ! <input type="text" name="sqlserver" value="<?php echo htmlentities($sqlhost); ?>" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="sqluser">Database User Name</label> ! <input type="text" name="sqluser" value="<?php echo htmlentities($sqluser); ?>" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="sqlpassword">Database User Password</label> ! <input type="password" name="sqlpassword" value="<?php echo htmlentities($sqlpass); ?>" /> ! </dd> ! <dt></dt> ! <dd> ! <label for="sqldatabase">Database Name</label> ! <input type="text" name="sqldatabase" value="openfirst" /> ! </dd> ! <dt>(I this database does not already exist, the user entered above must have access to create it.</dt> ! </dl> ! </fieldset> ! ! <fieldset> ! <legend>Linking Options</legend> ! <dl class="setup"> ! <dd> ! <label for="home">Home Site</label> ! <input type="text" name="home" value="http://<?php echo htmlentities("$server$basepath"); ?>" /> ! </dd> ! <dt>This address will used for linking to your main page.</dt> ! <dd> ! <label for="header">Header file</label> ! <input type="text" name="header" value="<?php echo htmlentities(realpath("$fbasepath/style/headers.php")); ?>" /> ! </dd> ! <dt>This should be a full system path, eg, ! <code class="file">c:\inetpub\wwwroot\openfirst\style\header.php</code> or ! <code class="file">/home/site/public_html/openfirst/style/headers.php</code> ! </dt> ! <dd> ! <label for="footer">Footer file</label> ! <input type="text" name="footer" value="<?php echo htmlentities(realpath("$fbasepath/style/footers.php")); ?>" /> ! </dd> ! <dt>This should be a full system path, eg, ! <code class="file">c:\inetpub\wwwroot\openfirst\style\footers.php</code> or ! <code class="file">/home/site/public_html/openfirst/style/footers.php</code> ! </dt> ! <dd> ! <label for="">The server name</label> ! <input type="text" name="server" value="http://<?php echo htmlentities($server); ?>" /> ! <span class="warning">Must not have a trailing slash and must include a protocol.</span> ! </dd> ! <dt>eg, <code class="url"><b>http://openfirst.sourceforge.net</b>/openfirst</code></dt> ! <dd> ! <label for="basepath">URL base path</label> ! <input type="text" name="basepath" value="<?php echo htmlentities($basepath); ?>" /> ! <span class="warning">Must not have a trailing slash.</span> ! </dd> ! <dt>ie. example: <code class="url">http://openfirst.sourceforge.net<b>/openfirst</b></code>) this should ! always have a beginning slash but no ending slash. (If openFIRST is in the root directory, then leave blank.) ! </dt> ! <dd> ! <label for="fbasepath">File system path</label> ! <input type="text" name="fbasepath" value="<?php echo htmlentities($fbasepath); ?>" /> ! <span class="warning">Must not have a trailing slash.</span> ! </dd> ! <dt>eg, <code class="file">/home/openfirst/htdocs/openfirst</code> ! or <code class="file">c:\inetpub\wwwroot\openfirst</code>) this should not have a ending slash.</dt> ! </dl> ! </fieldset> ! ! <fieldset> ! <legend>Security Options</legend> ! <dl class="setup"> ! <dd> ! <label for="">Hashing method</label> ! <select name="encryption"> ! <option value='md5' selected='selected'>MD5 Message-Digest Algorithm</option> ! <option value='crypt'>Standard Unix DES-based encryption algorthm</option> ! <option value='crc32'>crc32 Polynomial</option> ! <option value='sha1'>US Secure Hash Algorithm 1 (sha1)</option> ! </select> ! </dd> ! <dt>If you are migrating from an existing system, this should be the same encryption ! style that system uses, otherwise all users will have to reset their password; otherwise, in ! most cases the default option is fine.</dt> ! <dd> ! <label for="cookielogins">Allow users to save their passwords?</label> ! <input type="checkbox" name="cookielogins" id="cookielogins" value="yes" checked />Allowed ! </dd> ! <dt>This feature uses cookies to automatically log in users into the openFIRST portal.</dt> ! <dd> ! <label for="allowreg">Allow users to register on the portal?</label> ! <input type="checkbox" name="allowreg" id="allowreg" value="yes" />Allowed ! </dd> ! <dt>Enabling this option will allow users to register on the website and log in to access the ! members area. Be careful when using this option.</dt> ! </dl> ! </fieldset> ! ! <fieldset> ! <legend>Mailing Options</legend> ! <dl class="setup"> ! <dd> ! <label for="mailnotify">Mail Notification</label> ! <input type="text" name="mailnotify" value="<?php echo htmlentities($mailto); ?>" /> ! </dd> ! <dt>The e-mail address used to notify you when significant events occur.</dt> ! <dd> ! <label for="mailfrom">Mail From</label> ! <input type="text" name="mailfrom" value="<?php echo htmlentities($mailfrom); ?>" /> ! </dd> ! <dt>The e-mail address that mail from the openFIRST site should appear to be from.</dt> ! </dl> ! </fieldset> ! <div class="center big"><button class="center big" type="submit">Set up openFIRST!</button></div> ! </form> ! <?php ! } ! if(is_readable("style/footers.php")) { ! include_once("style/footers.php"); ! } else { ! include_once("../style/footers.php"); ! } ! ?> |
From: charlie_t <cha...@us...> - 2005-08-24 23:09:47
|
Update of /cvsroot/openfirst/base/style In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3965/style Modified Files: Tag: REL1_1_BRANCH footers.php headers.php Log Message: This version of the code uses a folder called 'style'. this folder contains the 'image' folder footers.php/headers.php was trying to access. so i added /style to the <img> tags. the images now show up. -- Charles Toeppe Index: footers.php =================================================================== RCS file: /cvsroot/openfirst/base/style/footers.php,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** footers.php 24 Aug 2005 21:51:39 -0000 1.2.2.2 --- footers.php 24 Aug 2005 23:09:38 -0000 1.2.2.3 *************** *** 7,11 **** <table class="menu" width="100%" border="0" cellspacing="0" cellpadding="6"> <tr> ! <td class="menu" style="background=image: url('<?php echo("$basepath/images/"); ?>back-light.gif');"> <div> <div align="center">© Copyright 2002-2003 by <?php echo $title; ?>. --- 7,11 ---- <table class="menu" width="100%" border="0" cellspacing="0" cellpadding="6"> <tr> ! <td class="menu" style="background=image: url('<?php echo("$basepath/style/images/"); ?>back-light.gif');"> <div> <div align="center">© Copyright 2002-2003 by <?php echo $title; ?>. *************** *** 18,25 **** <div> <div align="right"><a href= ! "http://openfirst.sourceforge.net"><img src="<?php echo("$basepath/images/"); ?>poweredby-small.png" width="177" height="30" border="0" alt="Powered by openFIRST Software - http://openfirst.sourceforge.net"></a><a href= "http://validator.w3.org/check?uri=http%3A//openfirst.sourceforge.net/"> ! <img src="<?php echo("$basepath/images/"); ?>w3c401.png" alt="Valid HTML 4.01" width="88" height="31" border="0"></a> </div> </div> --- 18,25 ---- <div> <div align="right"><a href= ! "http://openfirst.sourceforge.net"><img src="<?php echo("$basepath/style/images/"); ?>poweredby-small.png" width="177" height="30" border="0" alt="Powered by openFIRST Software - http://openfirst.sourceforge.net"></a><a href= "http://validator.w3.org/check?uri=http%3A//openfirst.sourceforge.net/"> ! <img src="<?php echo("$basepath/style/images/"); ?>w3c401.png" alt="Valid HTML 4.01" width="88" height="31" border="0"></a> </div> </div> Index: headers.php =================================================================== RCS file: /cvsroot/openfirst/base/style/headers.php,v retrieving revision 1.6.2.2 retrieving revision 1.6.2.3 diff -C2 -d -r1.6.2.2 -r1.6.2.3 *** headers.php 24 Aug 2005 21:51:39 -0000 1.6.2.2 --- headers.php 24 Aug 2005 23:09:38 -0000 1.6.2.3 *************** *** 48,56 **** <table width="100%" border="0" cellspacing="0" cellpadding="6"> <tr> ! <td> <img src="<?php echo("$basepath/images/"); ?>openfirst.png" alt="openFIRST Portal System"> </td> </tr> <tr> ! <th id="topmenu" style="background-image: url('<?php echo($basepath); ?>/images/back.gif');"> <?php if(ISSET($headers)){ --- 48,56 ---- <table width="100%" border="0" cellspacing="0" cellpadding="6"> <tr> ! <td> <img src="<?php echo("$basepath/style/images/"); ?>openfirst.png" alt="openFIRST Portal System"> </td> </tr> <tr> ! <th id="topmenu" style="background-image: url('<?php echo($basepath); ?>/style/images/back.gif');"> <?php if(ISSET($headers)){ *************** *** 71,75 **** </tr> <tr> ! <td style="background-image: url('<?php echo("$basepath/images/"); ?>back-light.gif'); "> <table width="100%" border="0" cellspacing="0" cellpadding="0"> --- 71,75 ---- </tr> <tr> ! <td style="background-image: url('<?php echo("$basepath/style/images/"); ?>back-light.gif'); "> <table width="100%" border="0" cellspacing="0" cellpadding="0"> *************** *** 115,119 **** ?> <tr> ! <td id="adminmenu" background="<?php echo("$basepath/images/"); ?>back-admin.png"><b>Admin Options -</b> <?php // Print admin navigation bar --- 115,119 ---- ?> <tr> ! <td id="adminmenu" background="<?php echo("$basepath/style/images/"); ?>back-admin.png"><b>Admin Options -</b> <?php // Print admin navigation bar |
From: Jamie <ast...@us...> - 2005-08-24 22:24:06
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25044/includes Modified Files: Tag: REL1_1_BRANCH auth.php dbase.php Log Message: Fixes, PEAR removal Index: auth.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/auth.php,v retrieving revision 1.5.2.2 retrieving revision 1.5.2.3 diff -C2 -d -r1.5.2.2 -r1.5.2.3 *** auth.php 24 Aug 2005 21:53:18 -0000 1.5.2.2 --- auth.php 24 Aug 2005 22:23:58 -0000 1.5.2.3 *************** *** 126,130 **** } } ! } elseif(isset($_POST["login"]) == true && isset($_POST["password"]) == true) { $query = ofirst_dbquery("SELECT * FROM ofirst_members WHERE user='" . $_POST["login"] . "';"); --- 126,130 ---- } } ! } elseif( isset($_POST["login"]) && isset($_POST["password"]) ) { $query = ofirst_dbquery("SELECT * FROM ofirst_members WHERE user='" . $_POST["login"] . "';"); *************** *** 135,139 **** session_register("authcode"); mt_srand(microtime() * 1000000); ! $_SESSION["authcode"] = (microtime()|mt_rand(1,mt_getrandmax())).substr($_SERVER["REMOTE_HOST"],0,40); $aquery = ofirst_dbquery("UPDATE ofirst_members SET authcode='" . $_SESSION["authcode"] . "' WHERE user='" . $_POST["login"] . "';"); if(!isset($pass_save_disabled)){ --- 135,139 ---- session_register("authcode"); mt_srand(microtime() * 1000000); ! $_SESSION["authcode"] = (microtime()|mt_rand(1,mt_getrandmax())).substr($_SERVER["REMOTE_ADDR"],0,40); $aquery = ofirst_dbquery("UPDATE ofirst_members SET authcode='" . $_SESSION["authcode"] . "' WHERE user='" . $_POST["login"] . "';"); if(!isset($pass_save_disabled)){ *************** *** 148,155 **** } } else { unset($user); } } ! } } --- 148,156 ---- } } else { + echo "Passwords don't match"; unset($user); } } ! } else echo "DB Error: ".ofirst_dberror(); } Index: dbase.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/dbase.php,v retrieving revision 1.7.2.2 retrieving revision 1.7.2.3 diff -C2 -d -r1.7.2.2 -r1.7.2.3 *** dbase.php 24 Aug 2005 21:53:18 -0000 1.7.2.2 --- dbase.php 24 Aug 2005 22:23:58 -0000 1.7.2.3 *************** *** 26,49 **** // without having to be completely rewritten or released as two // different versions. ! if(isset($dbasetype) == false) { $dbasetype = "mysql"; } ! - $connectdsn = ""; - if(isset($peardb) && $peardb) { - // Include the PEAR Database Abstraction Layer - include_once("DB.php"); - } elseif(! isset($peardb)) { - $peardb = false; - } // Wrapper for database selection. function ofirst_dbconnect($server = "", $username = "", $password = "", $newlink = "", $intclientflags = "") { ! global $dbasetype, $peardb, $connectdsn; ! echo("CONNECT"); ! if($peardb) { ! $connectdsn = "$dbasetype://$username:$password@$server/"; ! return(0); ! } elseif($dbasetype == "mysql") { if(function_exists("mysql_connect") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); --- 26,37 ---- // without having to be completely rewritten or released as two // different versions. ! if(!isset($dbasetype)) { $dbasetype = "mysql"; } // Wrapper for database selection. function ofirst_dbconnect($server = "", $username = "", $password = "", $newlink = "", $intclientflags = "") { ! global $dbasetype; ! if($dbasetype == "mysql") { if(function_exists("mysql_connect") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); *************** *** 75,83 **** function ofirst_select_db($databasename, $linkidentifier = "") { ! global $dbasetype, $peardb, $connectdsn; ! echo "SELECTDB"; ! if($peardb) { ! return($connectdsn =& DB::connect("$connectdsn$databasename")); ! } elseif($dbasetype == "mysql") { if(function_exists("mysql_select_db") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); --- 63,68 ---- function ofirst_select_db($databasename, $linkidentifier = "") { ! global $dbasetype; ! if($dbasetype == "mysql") { if(function_exists("mysql_select_db") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); *************** *** 102,113 **** function ofirst_dberrno($linkidentifier = "") { ! global $dbasetype, $peardb; ! if($peardb) { ! if($linkidentifier != "") { ! return(DB_Error::getCode($linkidentifier)); ! } else { ! return(DB_Error::getCode()); ! } ! } elseif($dbasetype == "mysql") { if(function_exists("mysql_errno") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); --- 87,92 ---- function ofirst_dberrno($linkidentifier = "") { ! global $dbasetype; ! if($dbasetype == "mysql") { if(function_exists("mysql_errno") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); *************** *** 137,148 **** function ofirst_dberror($linkidentifier = "") { ! global $dbasetype, $peardb; ! if($peardb) { ! if($linkidentifier != "") { ! return(DB_Error::getMessage($linkidentifier)); ! } else { ! return(DB_Error::getMessage()); ! } ! } elseif($dbasetype == "mysql") { if(function_exists("mysql_error") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); --- 116,121 ---- function ofirst_dberror($linkidentifier = "") { ! global $dbasetype; ! if($dbasetype == "mysql") { if(function_exists("mysql_error") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); *************** *** 172,186 **** function ofirst_dbquery($string, $linkidentifier = "", $batchsize = "") { ! global $dbasetype, $peardb, $sqlconnection; ! if($peardb) { ! if($batchsize != "") { ! return($sqlconnection->query($string, $linkidentifier, $batchsize)); ! } elseif($linkidentifier != "") { ! return($sqlconnection->query($string, $linkidentifier)); ! } else { ! print_r($sqlconnection); ! return($sqlconnection->query($string)); ! } ! } elseif($dbasetype == "mysql") { if(function_exists("mysql_query") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); --- 145,150 ---- function ofirst_dbquery($string, $linkidentifier = "", $batchsize = "") { ! global $dbasetype, $sqlconnection; ! if($dbasetype == "mysql") { if(function_exists("mysql_query") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); *************** *** 213,225 **** function ofirst_dbfetch_object($resource, $rownumber = "") { ! global $dbasetype, $peardb; ! if($peardb) { ! if($rownumber != "") { ! return(DB_FETCHMODE_OBJECT($resource, $rownumber)); ! } else { ! return(DB_FETCHMODE_OBJECT($resource)); ! } ! ! } elseif($dbasetype == "mysql") { if(function_exists("mysql_fetch_object") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); --- 177,182 ---- function ofirst_dbfetch_object($resource, $rownumber = "") { ! global $dbasetype; ! if($dbasetype == "mysql") { if(function_exists("mysql_fetch_object") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); *************** *** 247,258 **** function ofirst_dbnum_rows($resource) { ! global $dbasetype, $peardb; ! if($peardb) { ! if($resource != "") { ! return(DB_result::numRows($resource)); ! } else { ! return(DB_result::numRows()); ! } ! } elseif($dbasetype == "mysql") { if(function_exists("mysql_num_rows") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); --- 204,209 ---- function ofirst_dbnum_rows($resource) { ! global $dbasetype; ! if($dbasetype == "mysql") { if(function_exists("mysql_num_rows") == false) { die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); |
From: Jamie <ast...@us...> - 2005-08-24 21:57:02
|
Update of /cvsroot/openfirst/base/includes/functions/wysiwyg/modules/imagemap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15720/includes/functions/wysiwyg/modules/imagemap Added Files: Tag: REL1_1_BRANCH arr.gif genMove.js index.php msmove.js trans.gif Log Message: directory restructuring --- NEW FILE: arr.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: genMove.js --- /////////////////////////////////////////////////////////////////////// // This script was designed by Erik Arvidsson for WebFX // // // // For more info and examples see: http://webfx.eae.net // // or send mail to er...@ea... // // // // Feel free to use this code as lomg as this disclaimer is // // intact. // /////////////////////////////////////////////////////////////////////// var checkZIndex = true; var dragobject = null; var tx; var ty; var ie5 = document.all != null && document.getElementsByTagName != null; function getReal(el) { temp = el; while ((temp != null) && (temp.tagName != "BODY")) { if ((temp.className == "moveme") || (temp.className == "handle")){ el = temp; return el; } temp = temp.parentElement; } return el; } function moveme_onmousedown() { el = getReal(window.event.srcElement) if (el.className == "moveme" || el.className == "handle") { if (el.className == "handle") { tmp = el.getAttribute("handlefor"); if (tmp == null) { dragobject = null; return; } else dragobject = eval(tmp); } else dragobject = el; if (checkZIndex) makeOnTop(dragobject); ty = window.event.clientY - getTopPos(dragobject); tx = window.event.clientX - getLeftPos(dragobject); window.event.returnValue = false; window.event.cancelBubble = true; } else { dragobject = null; } } function moveme_onmouseup() { if(dragobject) { dragobject = null; } } function moveme_onmousemove() { if (dragobject) { if (window.event.clientX >= 0 && window.event.clientY >= 0) { dragobject.style.left = window.event.clientX - tx; dragobject.style.top = window.event.clientY - ty; } window.event.returnValue = false; window.event.cancelBubble = true; } } function getLeftPos(el) { if (ie5) { if (el.currentStyle.left == "auto") return 0; else return parseInt(el.currentStyle.left); } else { return el.style.pixelLeft; } } function getTopPos(el) { if (ie5) { if (el.currentStyle.top == "auto") return 0; else return parseInt(el.currentStyle.top); } else { return el.style.pixelTop; } } function makeOnTop(el) { var daiz; var max = 0; var da = document.all; for (var i=0; i<da.length; i++) { daiz = da[i].style.zIndex; if (daiz != "" && daiz > max) max = daiz; } el.style.zIndex = max + 1; } if (document.all) { //This only works in IE4 or better document.onmousedown = moveme_onmousedown; document.onmouseup = moveme_onmouseup; document.onmousemove = moveme_onmousemove; } document.write("<style>"); document.write(".moveme {cursor: move;}"); document.write(".handle {cursor: move;}"); document.write("</style>"); --- NEW FILE: msmove.js --- var CurentMAP=''; var activeElements = new Array(); var activeElementCount = 0; var lTop, lLeft; var doMove = true; var doResize = false; function toggleMoveResize(e) { if (doMove) { doMove = false; doResize = true; //e.value = "Resizing, Click to Move"; } else { doMove = true; doResize = false; //e.value = "Moving, Click to Resize"; } } function mousedown() { //_imgOnMouseOver(); var mp; mp = findMoveable(window.event.srcElement); //if (!window.event.altKey) { if (true) { for (i=0; i<activeElementCount; i++) { if (activeElements[i] != mp) { try { if(mp.tagName.toLowerCase()=='div') { activeElements[i].style.borderWidth = "1px"; } } catch(e){} //createmapf['delete'].disabled=true; } } if (mp) { activeElements[0] = mp; CurentMAP=activeElements[0]; _setFormFromMap(); activeElementCount = 1; _areas_doborder1px4all() mp.style.borderWidth = "2px"; createmapf['delete'].disabled=false; } else { activeElementCount = 0; } } else { alert('int er'); if (mp) { if (mp.style.borderWidth != "2px") { activeElements[activeElementCount] = mp; activeElementCount++; mp.style.borderWidth = "2px"; CurentMAP=activeElements[0]; _setFormFromMap(); } } } //window.status = activeElementCount; lLeft = window.event.x; lTop = window.event.y; } document.onmousedown = mousedown; function doResizeit(Mx,My,activeElement_) { var pr_ = (parseInt(activeElement_.style.width)/2); //if (pr_>50) pr_=50; //alert(activeElement_); if ( parseInt(Mx) >= parseInt(activeElement_.style.left)+parseInt(activeElement_.style.width)-(pr_) || parseInt(My) >= parseInt(activeElement_.style.top)+parseInt(activeElement_.style.height)-10 ) { return true; } return false; } function ___MmosOvrr(activeElement_) { if (doResizeit(event.x,event.y,activeElement_)) { activeElement_.style.cursor = 'nw-resize';; } else { activeElement_.style.cursor = 'move';; } } function mousemove() { var i, dLeft, dTop; sx = window.event.x; sy = window.event.y; //_imgOnMouseOver(); for (i=0; i<activeElementCount; i++) { //if (doMove) var mapid=SAL__get_parsedimgmap_i(activeElements[i].id); if (doResizeit(sx,sy,activeElements[i])) { activeElements[i].style.cursor = 'nw-resize'; } else { activeElements[i].style.cursor = 'move'; } } if (window.event.button == 1) { //_imgOnMouseOver(); dLeft = sx - lLeft; dTop = sy - lTop; for (i=0; i<activeElementCount; i++) { //if (doMove) var mapid=SAL__get_parsedimgmap_i(activeElements[i].id); if (doResizeit(sx,sy,activeElements[i])) { resizeElement(activeElements[i], dLeft, dTop); } else { moveElement(activeElements[i], dLeft, dTop); } createmapf.mex.value=parseInt(document.getElementById('divmap'+mapid).style.width) createmapf.mey.value== parseInt(document.getElementById('divmap'+mapid).style.height) createmapf.msx.value=parseInt(document.getElementById('divmap'+mapid).style.left) createmapf.msy.value=parseInt(document.getElementById('divmap'+mapid).style.top) } lLeft = sx; lTop = sy; return false; } } function moveElement(mp, dLeft, dTop) { var e e = mp; e.style.posTop += dTop; e.style.posLeft += dLeft; } function resizeElement(mp, dLeft, dTop) { var e; e = mp; e.style.posHeight += dTop; e.style.posWidth += dLeft; } function findMoveable(e) { if (!e.tagName || e.tagName.toLowerCase() != "div") return null; if (e.moveable == 'true') return e; return findMoveable(e.parentElement); } function findDefinedMoveable(e) { if ((e.moveable == 'true') || (e.moveable == 'false')) return e; if (e.tagName == "BODY") return null; return findDefinedMoveable(e.parentElement); } function rfalse() { return false; } function _imgmapkeydowhdl() { try { if (window.event.keyCode == 8 || window.event.keyCode == 46 ) { _deleteMap_(); return; } else { if (CurentMAP && CurentMAP.style && CurentMAP.style.visibility == 'visible') { var _step = 1; if (window.event.ctrlKey) { _step = 5; } if (window.event.shiftKey) { if (window.event.keyCode ==37) { CurentMAP.style.width = parseInt(CurentMAP.style.width)-_step; return; } if (window.event.keyCode ==39) { CurentMAP.style.width = parseInt(CurentMAP.style.width)+_step; return; } if (window.event.keyCode ==38) { CurentMAP.style.height= parseInt(CurentMAP.style.height)-_step; return; } if (window.event.keyCode ==40) { CurentMAP.style.height = parseInt(CurentMAP.style.height)+_step; return; } } else { if (window.event.keyCode ==37) { CurentMAP.style.left = parseInt(CurentMAP.style.left)-_step; return; } if (window.event.keyCode ==39) { CurentMAP.style.left = parseInt(CurentMAP.style.left)+_step; return; } if (window.event.keyCode ==38) { CurentMAP.style.top = parseInt(CurentMAP.style.top)-_step; return; } if (window.event.keyCode ==40) { CurentMAP.style.top = parseInt(CurentMAP.style.top)+_step; return; } } } } } catch(e){;} } function SAL__get_parsedimgmap_i(rawname) { return rawname.replace(/divmap/,''); } function SAL__set___map_info() { var mapname=opener_oldMapName; for (var i=0; i<opener_DOM.all.length; i++) { if (opener_oldMapName.length > 0 && opener_DOM.all(i).tagName.toLowerCase() == 'map' && opener_DOM.all(i).getAttribute('name') == mapname) { for (var ia=1;opener_DOM.all(i+ia) && opener_DOM.all(i+ia).tagName.toLowerCase() == 'area' && ia < maxMaps ;ia++) { var _target = opener_DOM.all(i+ia).getAttribute('target'); var _href = opener_DOM.all(i+ia).getAttribute('href'); var _alt = opener_DOM.all(i+ia).getAttribute('alt'); var _coords = opener_DOM.all(i+ia).getAttribute('coords'); if (_coords.length >0) { var _coordsA = Array(); _coords = _coords.replace(/ /,''); _coords = _coords.replace(/ /,''); _coordsA = _coords.split(","); if (_coordsA.length==4) { document.getElementById('divmap'+ia).SALMAP_href= _href; document.getElementById('divmap'+ia).SALMAP_alt= _alt; document.getElementById('divmap'+ia).SALMAP_target= _target; document.getElementById('divmap'+ia).style.left= parseInt(_coordsA[0]); document.getElementById('divmap'+ia).style.top= parseInt(_coordsA[1]); document.getElementById('divmap'+ia).style.width= parseInt(_coordsA[2]-_coordsA[0]); document.getElementById('divmap'+ia).style.visibility= 'visible'; document.getElementById('divmap'+ia).style.height= parseInt(_coordsA[3]-_coordsA[1]); //alert(); } } } break; } } if (!document.____SAL_interval_imgmap_htmleditor_____ || document.____SAL_interval_imgmap_htmleditor_____=='undefined') { //document.____SAL_interval_imgmap_htmleditor_____ = window.setInterval("_editMap_()",500); } } function SAL___remove_____map(mapname) { for (var i=0; i<opener_DOM.all.length; i++) { if (opener_oldMapName.length > 0 && opener_DOM.all[i].tagName.toLowerCase() == 'map' && opener_DOM.all[i].getAttribute('name') == mapname) { try { opener_DOM.all[i].removeNode(true); } catch(e){alert('cant remove old map');} } } } function SAL___set_htdmled_imap(mapinfo) { // OPENER ABFRAGEN!!! //DECMD_IMAGEMAP_RANGE abfragen if (!mapinfo) { alert('FIXME'); return; } // Neue map adden // var succ=0; try { if (mapinfo['map_source'] && mapinfo['map_source'].length) { var map_el,area_; map_el = opener_DOM.createElement("map"); opener_oItem.insertAdjacentElement('afterEnd',map_el); map_el.setAttribute('name','__tmpmapname__'); map_el.insertAdjacentHTML('afterBegin', mapinfo['map_source']) } succ=1; } catch(e){alert("Internal error[mmap]");} if (succ==1) { if (mapinfo['map_name'] && mapinfo['map_name'] && mapinfo['map_name'].length) { //alert(opener.DECMD_IMAGEMAP_RANGE_ITEM.useMap); opener_oItem.setAttribute('useMap','#'+mapinfo['map_name']); opener_oItem.setAttribute('border','0'); } else { opener_oItem.removeAttribute('useMap'); } SAL___remove_____map(opener_oldMapName); if (mapinfo['map_name'] && mapinfo['map_name'] && mapinfo['map_name'].length) { map_el.setAttribute('name',mapinfo['map_name']); } window.dialogArguments['dhtmlobj'].Refresh(); window.dialogArguments['dhtmlobj'].style.display='none'; window.dialogArguments['dhtmlobj'].style.display='block'; window.dialogArguments['dhtmlobj'].Refresh(); //window.dialogArguments["opener"].SAL_chng_S_mode(); //window.dialogArguments["opener"].SAL_chng_S_mode(); } else { alert('internal error 656'); } self.close(); } function _imgOnClick_() { if (_createMap_()) { createmapf['delete'].disabled=false; return true; } return false; } function _getFreeMapId() { for(var i=0;i<maxMaps;i++) { if (document.getElementById('divmap'+i).style.visibility == 'hidden') { return i; } } return ''; } function _setFormFromMap() { createmapf.href.value= CurentMAP.SALMAP_href createmapf.alt.value=CurentMAP.SALMAP_alt createmapf.target.value=CurentMAP.SALMAP_target createmapf.msx.value= parseInt(CurentMAP.style.left) createmapf.msy.value= parseInt(CurentMAP.style.top) createmapf.mex.value= parseInt(CurentMAP.style.width) createmapf.mey.value= parseInt(CurentMAP.style.height) createmapf.mapid.value= parseInt(SAL__get_parsedimgmap_i(CurentMAP.id)) } function _editMap_() { // alert(); if (!CurentMAP) return; //alert(activeElements[0].style.visibility); CurentMAP.SALMAP_href = createmapf.href.value; CurentMAP.SALMAP_alt = createmapf.alt.value; CurentMAP.SALMAP_target = createmapf.target.value; return true; ; } function _areas_doborder1px4all() { for(var i=0;i<maxMaps;i++) { if (document.getElementById('divmap'+i).style.visibility == "visible") { document.getElementById('divmap'+i).style.borderWidth ="1px"; } } } function _createMap_() { var MapId = _getFreeMapId(); if (MapId.length <=0) { alert('no free Area available'); return false; } document.getElementById('divmap'+MapId).style.left = event.x; document.getElementById('divmap'+MapId).style.top = event.y; document.getElementById('divmap'+MapId).style.width = 50; document.getElementById('divmap'+MapId).style.height = 50; document.getElementById('divmap'+MapId).SALMAP_href = ''; document.getElementById('divmap'+MapId).SALMAP_alt = ''; document.getElementById('divmap'+MapId).SALMAP_target = ''; CurentMAP = document.getElementById('divmap'+MapId); _areas_doborder1px4all(); document.getElementById('divmap'+MapId).style.borderWidth = '2px'; document.getElementById('divmap'+MapId).style.visibility = 'visible'; _setFormFromMap(); return true; } function _generate_source_() { var map_source = ''; var img_atr = ''; for(var i=0;i<maxMaps ;i++) { if (document.getElementById('divmap'+i).style.visibility == 'visible') { map_source += '<area shape=RECT alt="'+document.getElementById('divmap'+i).SALMAP_alt+'" coords="'+parseInt(document.getElementById('divmap'+i).style.left)+','+parseInt(document.getElementById('divmap'+i).style.top)+','+(parseInt(document.getElementById('divmap'+i).style.left)+parseInt(document.getElementById('divmap'+i).style.width))+','+(parseInt(document.getElementById('divmap'+i).style.top)+parseInt(document.getElementById('divmap'+i).style.height))+'" target="'+document.getElementById('divmap'+i).SALMAP_target+'" href="'+document.getElementById('divmap'+i).SALMAP_href+'">'; } } if (map_source.length>0) { var name = _makeMapName(); img_atr = ' usemap="#'+name+'"' //map_source = '<map name="'+name+'">'+"\n"+map_source+'</map>'; } //return '<img src="'+Limg_tl+'" alt="" border="0"'+img_atr+'>'+map_source; var ret = Array(); ret['map_source'] = map_source; ret['map_name'] = name; return ret; } function _makeMapName() { if (opener_oldMapName && opener_oldMapName.length) { return opener_oldMapName; } var zeit = new Date(); return "Smap"+Date.UTC(zeit.getYear(),zeit.getMonth(),zeit.getDay(),zeit.getHours(),zeit.getMinutes(),zeit.getSeconds()); } function _deleteMap_() { if (createmapf['delete'].disabled == true) return; createmapf['delete'].disabled=true; CurentMAP.style.visibility= 'hidden'; CurentMAP.SALMAP_href= ''; CurentMAP.SALMAP_alt= ''; CurentMAP.SALMAP_target= ''; CurentMAP.style.left= '' CurentMAP.style.top= '' CurentMAP.style.width= '' CurentMAP.style.height= '' return; } function _mapCleanUpDirtyMapRefs() { var mapname=opener_oldMapName; var toDelMaps = new Array; var usedMapNames = new Array; for (var i=0; i<opener_DOM.all.length; i++) { if (opener_DOM.all(i).tagName.toLowerCase() == 'img' && opener_DOM.all(i).getAttribute('useMap') && opener_DOM.all(i).getAttribute('useMap').length > 0) { var _mapname = opener_DOM.all(i).getAttribute('useMap').replace(/#/,''); _mapname = _mapname.toLowerCase(); usedMapNames[_mapname] = 1; } } for (var i=0; i<opener_DOM.all.length; i++) { if (opener_DOM.all(i).tagName.toLowerCase() == 'map') { if ( opener_DOM.all(i).getAttribute('name') == '' ) { //KICK & DELETE toDelMaps[toDelMaps.length]=opener_DOM.all(i); continue; } var _mapname = opener_DOM.all(i).getAttribute('name'); _mapname = _mapname.toLowerCase(); if ( usedMapNames[_mapname] != 1) { //KICK toDelMaps[toDelMaps.length]=opener_DOM.all(i); usedMapNames[_mapname]++; } usedMapNames[_mapname]=0; } } var _mapname; var _err = ' - cleaned'; for(var i=0;i<toDelMaps.length;i++) { //alert(toDelMaps[i].getAttribute('name')); if (toDelMaps[i]) { try { //alert('del') toDelMaps[i].removeNode(true); } catch(e) { //alert('err') _err = ''; } } } if (toDelMaps.length>0) alert('NOTE: dirty HTML code dedected'+_err); return true; } document.onmousemove = mousemove; //document.onselectstart = rfalse; --- NEW FILE: index.php --- <? include ("../../../../../../std.inc.php3");?> <? __salomon__check__login(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Salomon Image Map Editor</title> <? SAL__include_std_js_scripts();?> <? __salomon__include__css(); ?> <!-- <script src="genMove.js" type="text/javascript"></script> --> <script src="msmove.js" type="text/javascript"></script> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> maxMaps = 100; if (!window.dialogArguments) { window.dialogArguments = Array; window.dialogArguments['opener'] = opener; } opener_DOM = window.dialogArguments['dhtmlobj'].DOM; opener_oSel = opener_DOM.selection; opener_oRange = opener_oSel.createRange() opener_oItem = opener_oRange.item(opener_oRange.length-1); opener_oldMapName = opener_oItem.getAttribute('usemap'); opener_oldMapName = opener_oldMapName.replace(/#/,''); Limg_tl = opener_oItem.src; Limg_tlW = opener_oItem.getAttribute('width'); Limg_tlH = opener_oItem.getAttribute('height'); _mapCleanUpDirtyMapRefs(); </SCRIPT> </head> <body bottommargin="0" leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0" topmargin="0" onload="SAL__set___map_info()"> <? #__salomon__include__body(); ?> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> var eimgatr=''; if (Limg_tlH) { eimgatr = ' height='+Limg_tlH+' '; } if (Limg_tlW) { eimgatr += ' width='+Limg_tlW+' '; } document.write('<img src="'+Limg_tl+'" '+eimgatr+' alt="" border="0" onclick="_imgOnClick_();" style="cursor:crosshair;">'); </SCRIPT> <br><br> <table> <tr> <td><strong>Map-Area Properties</strong></td> </tr> <tr> <td nowrap> <table cellpadding="0" cellspacing="0" border="1" bordercolor="#808080"><tr><td> <form name="createmapf"> <table cellpadding="0" cellspacing="2"> <tr valign="top"> <td>Hyperlink (href)</td> <td><input onfocus="document.onselectstart = '';document.onmousemove=''" onkeyup="_editMap_();" onblur="document.onselectstart = rfalse;document.onmousemove=mousemove;_editMap_()" type="text" name="href" value="" size="50"></td> </tr> <tr valign="top"> <td>Alt Text (alt)</td> <td><input onfocus="document.onselectstart = '';document.onmousemove=''" onkeyup="_editMap_()" onblur="document.onselectstart = rfalse;document.onmousemove=mousemove;_editMap_()" type="text" name="alt" value="" size="50"></td> </tr> <tr valign="top"> <td><a href="#" onclick="SAL_CHVIS_mod('advmappr')" title="Click here for Advanced Properties">Advanced</a></td> <td></td> </tr> <tr valign="top" style="display:none;" id="advmappr"> <td>Target</td> <td><input onfocus="document.onselectstart = '';document.onmousemove=''" onkeyup="_editMap_()" onblur="document.onselectstart = rfalse;document.onmousemove=mousemove;_editMap_()" type="text" name="target" value="" size="10"> _self _parent _top _blank </td> </tr> </table> <span style="display:none;">Map X:<input type="text" name="msx" value="" size="3"><br></span> <span style="display:none;">Map Y:<input type="text" name="msy" value="" size="3"><br></span> <span style="display:none;">Map Width X:<input type="text" name="mex" value="50" size="3"><br></span> <span style="display:none;">Map Heigh Y:<input type="text" name="mey" value="50" size="3"><br></span> <span style="display:none;">Map Number: <input type="text" name="mapid" value="" size="3"><br></span> <br><input style="display:none; disabled type="button" name="create" value="Create" > <input disabled type="button" name="delete" value="Delete Area" onclick="_deleteMap_()"> <!-- <input type="button" value="Make" onclick="alert(_generate_source_())"> --> <input type="button" value="Save Image Map" onclick="_editMap_();SAL___set_htdmled_imap(_generate_source_())"> <input style="display:none;" disabled type="button" name="edit" value="Edit" onclick="_editMap_()"> </form> </td></tr></table> <br> <strong><a onclick="SAL_CHVIS_mod('helpsp')" href="#" title="Click here for Help">Quick-Help</a></strong><br> <span id=helpsp style="display:none;"> - You can add a Map-Area by a LEFT-MOUSE-CLICK on a free Area at the Image<br> - You can edit a Map-Area by a LEFT-MOUSE-CLICK on the Map-Area (red-marked), then you have to fill out the form<br> - You can delete a Map-Area by a LEFT-MOUSE-CLICK on the Map-Area (red-marked), then you have to click the DELETE button<br> - You can finetune a Map-Area by the curser keys<br> - You can move and resize a Map-Area via DRAG and DROP<br> - When you finished you have to click "Save Image Map" </span> </td> </tr> </table> <br><br> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> for(var i=0;i<maxMaps;i++) { var _Estyle = ' visibility:hidden; '; document.writeln('<div onkeyDown="_imgmapkeydowhdl()" onmousemove="___MmosOvrr(this);mousemove()" moveable=true id="divmap'+i+'" style="position:absolute; left:0px; top:0px; width:0px; height:0px; z-index:'+(i+1)+'; '+_Estyle+' border: 1px solid Red; background-image: url(trans.gif);"><!-- <font color="Red"><strong> '+i+'</strong></font> --></div>'); document.getElementById('divmap'+i).SALMAP_href= ''; document.getElementById('divmap'+i).SALMAP_alt= ''; document.getElementById('divmap'+i).SALMAP_target= ''; } </SCRIPT> <? page_close();?> </body> </html> --- NEW FILE: trans.gif --- (This appears to be a binary file; contents omitted.) |