Changeset 32
- Timestamp:
- Dec 11, 2005 7:33:45 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/install.sh
r31 r32 14 14 15 15 # If old log locations exists, copy to new directory. 16 if [ -f "$sitebase/codebase/logs/app_error_log" ] || [ -f "$sitebase/codebase/logs/php_error_log"]; then16 if [ `ls -1 $sitebase/codebase/logs/ | wc -l` -gt 0 ]; then 17 17 echo "Moving logs to new log directory: $sitebase/log/"; 18 mv -v --backup$sitebase/codebase/logs/* $sitebase/log/;18 mv -vfb $sitebase/codebase/logs/* $sitebase/log/; 19 19 fi 20 20 -
trunk/lib/App.inc.php
r31 r32 81 81 82 82 // For classes that require db tables, do we check that a table exists and create if missing? 83 'db_create_tables' => null,83 'db_create_tables' => true, 84 84 85 85 // The level of error reporting. Don't set this to 0 to suppress messages, instead use display_errors to control display. … … 366 366 $this =& App::getInstance(); 367 367 } 368 369 if (!$this->running) { 368 369 $message = trim($message); 370 371 if (!$this->running || '' == $message) { 370 372 return false; 371 373 } … … 543 545 /** 544 546 * Sets which query arguments will be carried persistently between requests. 545 * Values in the _carry_queries array will be copied to URLs (via oHREF()) and547 * Values in the _carry_queries array will be copied to URLs (via App::url()) and 546 548 * to hidden input values (via printHiddenSession()). 547 549 * … … 566 568 /** 567 569 * Outputs a fully qualified URL with a query of all the used (ie: not empty) 568 * keys and values, including optional queries. This allows simple printing of569 * links without needing to know which queries to add to it. If cookies are not570 * keys and values, including optional queries. This allows mindless retention 571 * of query arguments across page requests. If cookies are not 570 572 * used, the session id will be propogated in the URL. 571 573 * 572 * @param string $url 573 * @param mixed $carry_args 574 * 575 * -array('key1', key2', key3') <-- to save these keys if in the form data.576 * -array('key1'=>'value', key2'='value') <-- to set keys to default values if not present in form data.577 * -false <-- To not carry any queries. If URL already has queries those will be retained.574 * @param string $url The initial url 575 * @param mixed $carry_args Additional url arguments to carry in the query, 576 * or FALSE to prevent carrying queries. Can be any of the following formats: 577 * array('key1', key2', key3') <-- to save these keys if in the form data. 578 * array('key1'=>'value', key2'='value') <-- to set keys to default values if not present in form data. 579 * false <-- To not carry any queries. If URL already has queries those will be retained. 578 580 * 579 581 * @param mixed $always_include_sid Always add the session id, even if using_trans_sid = true. This is required when … … 583 585 * @return string url with attached queries and, if not using cookies, the session id 584 586 */ 585 function oHREF($url='', $carry_args=null, $always_include_sid=false)587 function url($url, $carry_args=null, $always_include_sid=false) 586 588 { 587 589 if (!isset($this) || !is_a($this, 'App')) { … … 617 619 618 620 // Get the first delimiter that is needed in the url. 619 $delim = preg_match('/\?/', $url) ? ini_get('arg_separator.output') : '?'; 621 $delim = strpos($url, '?') !== false ? ini_get('arg_separator.output') : '?'; 622 620 623 621 624 $q = ''; … … 667 670 } 668 671 } 672 673 /** 674 * Returns a HTML-friendly URL processed with App::url and & replaced with & 675 * 676 * @access public 677 * @param string $url Input URL to parse. 678 * @return string URL with App::url() and htmlentities() applied. 679 * @author Quinn Comendant <quinn@strangecode.com> 680 * @since 09 Dec 2005 17:58:45 681 */ 682 function oHREF($url, $carry_args=null, $always_include_sid=false) 683 { 684 if (!isset($this) || !is_a($this, 'App')) { 685 $this =& App::getInstance(); 686 } 687 688 $url = $this->url($url, $carry_args, $always_include_sid); 689 690 // Replace any & not followed by an html or unicode entity with it's & equivalent. 691 $url = preg_replace('/&(?![\w\d#]{1,10};)/', '&', $url); 692 693 return $url; 694 } 669 695 670 696 /** … … 674 700 * @param mixed $carry_args Additional url arguments to carry in the query, 675 701 * or FALSE to prevent carrying queries. Can be any of the following formats: 676 * -array('key1', key2', key3') <-- to save these keys if in the form data.677 * -array('key1'=>'value', key2'='value') <-- to set keys to default values if not present in form data.678 * -false <-- To not carry any queries. If URL already has queries those will be retained.702 * array('key1', key2', key3') <-- to save these keys if in the form data. 703 * array('key1'=>'value', key2'='value') <-- to set keys to default values if not present in form data. 704 * false <-- To not carry any queries. If URL already has queries those will be retained. 679 705 */ 680 706 function printHiddenSession($carry_args=null) 681 { 707 { 682 708 if (!isset($this) || !is_a($this, 'App')) { 683 709 $this =& App::getInstance(); … … 762 788 } 763 789 764 $url = $this-> oHREF($url, $carry_args, $always_include_sid);790 $url = $this->url($url, $carry_args, $always_include_sid); 765 791 766 792 header(sprintf('Location: %s', $url)); -
trunk/lib/Auth_SQL.inc.php
r31 r32 22 22 // Default param values. 23 23 var $_default_params = array( 24 25 // Message displayed by requireLogin(). 26 'login_required_message' => 'Please login', 24 27 25 28 // Automatically create table and verify columns. Better set to false after site launch. … … 537 540 * Redirect user to login page if they are not logged in. 538 541 * 539 * @param string $m sgThe text description of a message to raise.542 * @param string $message The text description of a message to raise. 540 543 * @param int $type The type of message: MSG_NOTICE, 541 544 * MSG_SUCCESS, MSG_WARNING, or MSG_ERR. … … 544 547 * @access public 545 548 */ 546 function requireLogin($m sg='', $type=MSG_NOTICE, $file=null, $line=null)549 function requireLogin($message='', $type=MSG_NOTICE, $file=null, $line=null) 547 550 { 548 551 if (!$this->isLoggedIn()) { 549 if ('' != $msg) {550 App::raiseMsg($msg, $type, $file, $line);551 } 552 // Display message for requiring login. 553 App::raiseMsg($message, $type, $file, $line); 554 552 555 // Login scripts must have the same 'login' tag for boomerangURL verification/manipulation. 553 556 App::setBoomerangURL(absoluteMe(), 'login'); … … 820 823 * @param constant $security_zone string of comma delimited priviliges for the zone 821 824 */ 822 function requireAccessClearance($security_zone, $m sg='')825 function requireAccessClearance($security_zone, $message='') 823 826 { 824 827 return true; … … 828 831 * user has no privilege, DIE with a message. */ 829 832 if (!in_array($this->getVal('priv'), $zone_members) || !$this->getVal('priv')) { 830 $m sg = empty($msg) ? _("You have insufficient privileges to view that page.") : $msg;831 App::raiseMsg($m sg, MSG_NOTICE, __FILE__, __LINE__);833 $message = empty($message) ? _("You have insufficient privileges to view that page.") : $message; 834 App::raiseMsg($message, MSG_NOTICE, __FILE__, __LINE__); 832 835 App::dieBoomerangURL(); 833 836 } -
trunk/lib/Captcha.inc.php
r31 r32 142 142 ?> 143 143 <label for="sc-captcha"><?php echo _("Reverse Turing Test") ?></label> 144 <p class="help"> Please enter the number here to prove you are a human. This is a measure to prevent spam robots from submitting this form.</p>145 <pre style="font-size: 1px;"><?php echo $ascii ?></pre>144 <p class="help"><?php echo _("Please type the following number to prove you are a human. This is a measure to prevent spam robots from submitting this form.") ?></p> 145 <pre style="font-size: 0.5em;"><?php echo $ascii ?></pre> 146 146 <input name="sc-captcha" id="sc-captcha" type="text" /> 147 147 <input name="sc-captcha-hash" type="hidden" value="<?php echo $hash ?>" /> -
trunk/lib/TemplateGlue.inc.php
r31 r32 105 105 } 106 106 } 107 foreach ($values as $item) { 108 $selected = ($item == $preselected) ? ' selected' : ''; 109 ?><option value="<?php echo $item; ?>"<?php echo $selected; ?>><?php echo oTxt($item); ?></option> 107 foreach ($values as $v) { 108 $selected = ($v == $preselected) ? ' selected' : ''; 109 ?><option value="<?php echo $v; ?>"<?php echo $selected; ?>><?php echo oTxt($v); ?></option> 110 <?php 111 } 112 } 113 114 /** 115 * Prints radio buttons from a set/enum column. 116 * 117 * @param string $db_table database table to lookup 118 * @param string $db_col database column to lookup 119 */ 120 function printEnumRadios($name, $db_table, $db_col, $preselected, $blank=false) 121 { 122 $values = getSetEnumFieldValues($db_table, $db_col); 123 if ($values === false) { 124 return false; 125 } 126 127 foreach ($values as $v) { 128 $selected = ($v == $preselected) ? ' selected' : ''; 129 ?><input type="radio" name="<?php echo $name ?>" id="<?php echo $v; ?>" value="<?php echo $v; ?>"<?php echo $selected; ?> /><label for="<?php echo $v; ?>"><?php echo oTxt($v); ?></label> 110 130 <?php 111 131 } … … 150 170 $row_cnt = 0; 151 171 $col_cnt = 0; 152 foreach ($values as $ item) {172 foreach ($values as $v) { 153 173 if ($col_cnt == $columns) { 154 174 // Begin a new row. … … 166 186 167 187 // Look for preselected value. 168 if (in_array($ item, $preselected)) {188 if (in_array($v, $preselected)) { 169 189 $checked = ' checked="checked"'; 170 190 } else { … … 173 193 if ('allone' == $flag) { 174 194 // Print a cell with multidimentioal array checkboxes. 175 $html_name = 'dbcol[' . $db_col . '][' . $ item. ']';195 $html_name = 'dbcol[' . $db_col . '][' . $v . ']'; 176 196 } else { 177 197 // Print a cell with basic named checkboxes. 178 $html_name = $db_col . '[' . $ item. ']';179 } 180 ?><td><input type="checkbox" name="<?php echo $html_name ?>" id="<?php echo $html_name ?>"<?php echo $checked; ?> /><label for="<?php echo $html_name ?>"><?php echo oTxt($ item); ?></label></td>198 $html_name = $db_col . '[' . $v . ']'; 199 } 200 ?><td><input type="checkbox" name="<?php echo $html_name ?>" id="<?php echo $html_name ?>"<?php echo $checked; ?> /><label for="<?php echo $html_name ?>"><?php echo oTxt($v); ?></label></td> 181 201 <?php 182 202 } … … 228 248 $row_cnt = 0; 229 249 $col_cnt = 0; 230 foreach ($values as $ item) {250 foreach ($values as $v) { 231 251 if ($col_cnt == $columns) { 232 252 // Begin a new row. … … 244 264 245 265 // Look for preselected value. 246 if (in_array($ item, $preselected)) {266 if (in_array($v, $preselected)) { 247 267 $checked = ' checked="checked"'; 248 268 } else { … … 250 270 } 251 271 // Print a cell with basic named checkboxes. 252 ?><td><input type="radio" name="<?php echo $db_col; ?>" id="<?php echo $db_col; ?>" value="<?php echo $ item ?>"<?php echo $checked; ?> /><label for="<?php echo $db_col ?>"><?php echo oTxt($item); ?></label></td>272 ?><td><input type="radio" name="<?php echo $db_col; ?>" id="<?php echo $db_col; ?>" value="<?php echo $v ?>"<?php echo $checked; ?> /><label for="<?php echo $db_col ?>"><?php echo oTxt($v); ?></label></td> 253 273 <?php 254 274 } -
trunk/lib/Utilities.inc.php
r31 r32 97 97 98 98 // & becomes &. Exclude any occurance where the & is followed by a alphanum or unicode caracter. 99 $search['ampersand'] = '/&( (?![\w\d#]{1,10};))/';100 $replace['ampersand'] = '& \\1';99 $search['ampersand'] = '/&(?![\w\d#]{1,10};)/'; 100 $replace['ampersand'] = '&'; 101 101 102 102 return preg_replace($search, $replace, htmlentities($txt, ENT_QUOTES, App::getParam('character_set')));
Note: See TracChangeset
for help on using the changeset viewer.