Changeset 768
- Timestamp:
- Jun 9, 2022 7:24:04 PM (23 months ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/list_template.cli.php
r664 r768 117 117 'longblob' == $type 118 118 ) { 119 $listrows[] = "<\x3fphp echo mb_strlen(\$list[\$i]['$field'])<50 \x3f oTxt(\$list[\$i]['$field'] , true) : oTxt(trim(mb_substr(\$list[\$i]['$field'], 0, 50)) . '...'); \x3f>";119 $listrows[] = "<\x3fphp echo mb_strlen(\$list[\$i]['$field'])<50 \x3f oTxt(\$list[\$i]['$field']) : oTxt(trim(mb_substr(\$list[\$i]['$field'], 0, 50)) . '...'); \x3f>"; 120 120 } else if (preg_match('/.*(begin|start).*date.*/i', $field)) { 121 121 $listrows[] = "<\x3fphp echo \$db->getParam('zero_date') == \$list[\$i]['$field'] ? '' : date(\$app->getParam('date_format'), strtotime(\$list[\$i]['$field'])); \x3f>"; … … 135 135 $listrows[] = "<input type=\"text\" name=\"rank[<\x3fphp echo \$list[\$i]['$primary_key']; \x3f>]\" value=\"<\x3fphp echo \$list[\$i]['rank']; \x3f>\" size=\"5\" />"; 136 136 } else { 137 $listrows[] = "<\x3fphp echo oTxt(\$list[\$i]['$field'] , true); \x3f>";137 $listrows[] = "<\x3fphp echo oTxt(\$list[\$i]['$field']); \x3f>"; 138 138 } 139 139 } -
trunk/lib/App.inc.php
r767 r768 430 430 // DB credentials for CLI scripts stored in a JSON file with read rights given only to the user who will be executing the scripts: -r-------- 431 431 // But not if all DB credentials have been defined already by other means. 432 if ( $this->cli &&'' != $this->getParam('db_auth_file') && (!$this->getParam('db_server') || !$this->getParam('db_name') || !$this->getParam('db_user') || !$this->getParam('db_pass'))) {432 if ('' != $this->getParam('db_auth_file') && (!$this->getParam('db_server') || !$this->getParam('db_name') || !$this->getParam('db_user') || !$this->getParam('db_pass'))) { 433 433 if (false !== ($db_auth_file = stream_resolve_include_path($this->getParam('db_auth_file')))) { 434 434 if (is_readable($db_auth_file)) { … … 664 664 if ($num_queries > 0 && true === $this->getParam('enable_db_pdo')) { 665 665 // If the app wants to use PDO, warn if any legacy db queries are made. 666 $this->logMsg(sprintf('%s queries using legacy DB functions', $num_queries), LOG_ WARNING, __FILE__, __LINE__);666 $this->logMsg(sprintf('%s queries using legacy DB functions', $num_queries), LOG_DEBUG, __FILE__, __LINE__); 667 667 } 668 668 $this->db->close(); -
trunk/lib/Auth_Simple.inc.php
r745 r768 11 11 12 12 // Namespace of this auth object. 13 var$_ns;13 protected $_ns; 14 14 15 15 // Parameters to be configured by setParam. 16 var$_params = array();17 var$_default_params = array(16 protected $_params = array(); 17 protected $_default_params = array( 18 18 19 19 // The URL to the login script. -
trunk/lib/PageNumbers.inc.php
r635 r768 71 71 { 72 72 // Default options for the quantity per page links. 73 $this->per_page_options = array( 25, 50, 100, 200);73 $this->per_page_options = array(50, 100, 250, 1000); 74 74 75 75 // Default options for the page number links. -
trunk/lib/Utilities.inc.php
r765 r768 998 998 } 999 999 return $url_args; 1000 } 1001 1002 /* 1003 * Encode/decode a string that is safe for URLs. 1004 * 1005 * @access public 1006 * @param string $string Input string 1007 * @return string Encoded/decoded string. 1008 * @author Rasmus Schultz <https://www.php.net/manual/en/function.base64-encode.php#123098> 1009 * @since 09 Jun 2022 07:50:49 1010 */ 1011 function base64_encode_url($string) { 1012 return str_replace(['+','/','='], ['-','_',''], base64_encode($string)); 1013 } 1014 function base64_decode_url($string) { 1015 return base64_decode(str_replace(['-','_'], ['+','/'], $string)); 1000 1016 } 1001 1017 -
trunk/lib/Validator.inc.php
r767 r768 348 348 } 349 349 350 if ($strict) { 351 // Strict tests. 352 if (ip2long($domain) === false && function_exists('checkdnsrr') && !checkdnsrr($domain . '.', 'MX') && gethostbyname($domain) == $domain) { 353 // Check domain exists: It's a domain if ip2long fails; checkdnsrr ensures a MX record exists; gethostbyname() ensures the domain exists. 354 $app->logMsg(sprintf('%s (line %s) failed: %s', __METHOD__, __LINE__, getDump($val)), $type, $file, $line); 355 return self::EMAIL_MX_FAIL; 356 } 350 if ($strict && getmxrr('checkdnsrr') && !getmxrr($domain)) { 351 // Strict tests: check if MX record exists. 352 $app->logMsg(sprintf('%s (line %s) failed: %s', __METHOD__, __LINE__, getDump($val)), $type, $file, $line); 353 return self::EMAIL_MX_FAIL; 357 354 } 358 355 -
trunk/services/templates/admin_list.ihtml
r497 r768 68 68 } 69 69 ?></td> 70 <td class="sc-nowrap"><?php echo gethostbyaddr($list[$i]['last_login_ip']); ?></td>70 <td class="sc-nowrap"><?php echo ipInRange($list[$i]['last_login_ip'], ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16']) ? "(Private IP)" : sprintf('<a href="https://ip.me/ip/%1$s">%1$s</a>', $list[$i]['last_login_ip']); ?></td> 71 71 <td class="sc-nowrap"><?php echo Validator::validateStrDate($list[$i]['added_datetime']) ? date($app->getParam('date_format'), strtotime($list[$i]['added_datetime'])) : ''; ?></td> 72 72 <td class="sc-nowrap"><?php echo oTxt($list[$i]['added_admin_username'], true); ?></td>
Note: See TracChangeset
for help on using the changeset viewer.