Index: branches/5.3.x/core/kernel/utility/logger.php =================================================================== --- branches/5.3.x/core/kernel/utility/logger.php (revision 16544) +++ branches/5.3.x/core/kernel/utility/logger.php (revision 16545) @@ -1,1413 +1,1477 @@ 'logger.php', 'kErrorHandlerStack' => 'logger.php', 'kExceptionHandlerStack' => 'logger.php', 'kDBConnection' => 'db_connection.php', 'kDBConnectionDebug' => 'db_connection.php', 'kDBLoadBalancer' => 'db_load_balancer.php', ); /** * Create event log * * @param Array $methods_to_call List of invokable kLogger class method with their parameters (if any) * @access public */ public function __construct($methods_to_call = Array ()) { parent::__construct(); $system_config = kUtil::getSystemConfig(); $this->_debugMode = $this->Application->isDebugMode(); $this->setState($system_config->get('EnableSystemLog', self::STATE_DISABLED)); $this->_maxLogLevel = $system_config->get('SystemLogMaxLevel', self::LL_NOTICE); foreach ($methods_to_call as $method_to_call) { call_user_func_array(Array ($this, $method_to_call[0]), $method_to_call[1]); } if ( !kUtil::constOn('DBG_ZEND_PRESENT') && !$this->Application->isDebugMode() ) { // don't report error on screen if debug mode is turned off error_reporting(0); ini_set('display_errors', 0); } register_shutdown_function(Array ($this, 'catchLastError')); } /** * Sets state of the logged (enabled/user-only/disabled) * * @param $new_state * @return void * @access public */ public function setState($new_state = null) { if ( isset($new_state) ) { $this->_state = (int)$new_state; } if ( $this->_state === self::STATE_ENABLED ) { $this->_enableErrorHandling(); } elseif ( $this->_state === self::STATE_DISABLED ) { $this->_disableErrorHandling(); } } /** * Enable error/exception handling capabilities * * @return void * @access protected */ protected function _enableErrorHandling() { $this->_disableErrorHandling(); $this->_handlers[self::LL_ERROR] = new kErrorHandlerStack($this); $this->_handlers[self::LL_CRITICAL] = new kExceptionHandlerStack($this); } /** * Disables error/exception handling capabilities * * @return void * @access protected */ protected function _disableErrorHandling() { foreach ($this->_handlers as $index => $handler) { $this->_handlers[$index]->__destruct(); unset($this->_handlers[$index]); } } /** * Initializes new log record. Use "kLogger::write" to save to db/disk * * @param string $message * @param int $code * @return kLogger * @access public */ public function prepare($message = '', $code = null) { $this->_logRecord = Array ( 'LogUniqueId' => kUtil::generateId(), 'LogMessage' => $message, 'LogLevel' => self::LL_INFO, 'LogCode' => $code, 'LogType' => self::LT_OTHER, 'LogHostname' => $_SERVER['HTTP_HOST'], 'LogRequestSource' => php_sapi_name() == 'cli' ? 2 : 1, 'LogRequestURI' => php_sapi_name() == 'cli' ? implode(' ', $GLOBALS['argv']) : $_SERVER['REQUEST_URI'], 'LogUserId' => USER_GUEST, 'IpAddress' => isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '', 'LogSessionKey' => 0, 'LogProcessId' => getmypid(), 'LogUserData' => '', 'LogNotificationStatus' => self::LNS_DISABLED, ); if ( $this->Application->isAdmin ) { $this->_logRecord['LogInterface'] = defined('CRON') && CRON ? self::LI_CRON_ADMIN : self::LI_ADMIN; } else { $this->_logRecord['LogInterface'] = defined('CRON') && CRON ? self::LI_CRON_FRONT : self::LI_FRONT; } if ( $this->Application->InitDone ) { $this->_logRecord['LogUserId'] = $this->Application->RecallVar('user_id'); $this->_logRecord['LogSessionKey'] = $this->Application->GetSID(); $this->_logRecord['IpAddress'] = $this->Application->getClientIp(); } return $this; } /** * Sets one or more fields of log record * * @param string|Array $field_name * @param string|null $field_value * @return kLogger * @access public * @throws UnexpectedValueException */ public function setLogField($field_name, $field_value = null) { if ( isset($field_value) ) { $this->_logRecord[$field_name] = $field_value; } elseif ( is_array($field_name) ) { $this->_logRecord = array_merge($this->_logRecord, $field_name); } else { throw new UnexpectedValueException('Invalid arguments'); } return $this; } /** * Sets user data * * @param string $data * @param bool $as_array * @return kLogger * @access public */ public function setUserData($data, $as_array = false) { if ( $as_array ) { $data = serialize((array)$data); } return $this->setLogField('LogUserData', $data); } /** * Add user data * * @param string $data * @param bool $as_array * @return kLogger * @access public */ public function addUserData($data, $as_array = false) { $new_data = $this->_logRecord['LogUserData']; if ( $as_array ) { $new_data = $new_data ? unserialize($new_data) : Array (); $new_data[] = $data; $new_data = serialize($new_data); } else { $new_data .= ($new_data ? PHP_EOL : '') . $data; } return $this->setLogField('LogUserData', $new_data); } /** * Adds event to log record * * @param kEvent $event * @return kLogger * @access public */ public function addEvent(kEvent $event) { $this->_logRecord['LogEventName'] = (string)$event; return $this; } /** * Adds log source file & file to log record * * @param string|Array $file_or_trace file path * @param int $line file line * @return kLogger * @access public */ public function addSource($file_or_trace = '', $line = 0) { if ( is_array($file_or_trace) ) { $trace_info = $file_or_trace[0]; $this->_logRecord['LogSourceFilename'] = $trace_info['file']; $this->_logRecord['LogSourceFileLine'] = $trace_info['line']; } else { $this->_logRecord['LogSourceFilename'] = $file_or_trace; $this->_logRecord['LogSourceFileLine'] = $line; } return $this; } /** * Adds session contents to log record * * @param bool $include_optional Include optional session variables * @return kLogger * @access public */ public function addSessionData($include_optional = false) { if ( $this->Application->InitDone ) { $this->_logRecord['LogSessionData'] = serialize($this->Application->Session->getSessionData($include_optional)); } return $this; } /** * Adds user request information to log record * * @return kLogger * @access public */ public function addRequestData() { $request_data = array( 'Headers' => $this->Application->HttpQuery->getHeaders(), ); $request_variables = Array('_GET' => $_GET, '_POST' => $_POST, '_COOKIE' => $_COOKIE); foreach ( $request_variables as $title => $data ) { if ( !$data ) { continue; } $request_data[$title] = $data; } $this->_logRecord['LogRequestData'] = serialize($request_data); return $this; } /** * Adds trace to log record * * @param Array $trace * @param int $skip_levels * @param Array $skip_files * @return kLogger * @access public */ public function addTrace($trace = null, $skip_levels = 1, $skip_files = null) { $trace = $this->createTrace($trace, $skip_levels, $skip_files); foreach ($trace as $trace_index => $trace_info) { if ( isset($trace_info['args']) ) { $trace[$trace_index]['args'] = $this->_implodeObjects($trace_info['args']); } } $this->_logRecord['LogBacktrace'] = serialize($this->_removeObjectsFromTrace($trace)); return $this; } /** * Remove objects from trace, since before PHP 5.2.5 there wasn't possible to remove them initially * * @param Array $trace * @return Array * @access protected */ protected function _removeObjectsFromTrace($trace) { if ( version_compare(PHP_VERSION, '5.3', '>=') ) { return $trace; } $trace_indexes = array_keys($trace); foreach ($trace_indexes as $trace_index) { unset($trace[$trace_index]['object']); } return $trace; } /** * Implodes object to prevent memory leaks * * @param Array $array * @return Array * @access protected */ protected function _implodeObjects($array) { $ret = Array (); foreach ($array as $key => $value) { if ( is_array($value) ) { $ret[$key] = $this->_implodeObjects($value); } elseif ( is_object($value) ) { if ( $value instanceof kEvent ) { $ret[$key] = 'Event: ' . (string)$value; } elseif ( $value instanceof kBase ) { $ret[$key] = (string)$value; } else { $ret[$key] = 'Class: ' . get_class($value); } } elseif ( strlen($value) > 200 ) { $ret[$key] = substr($value, 0, 50) . ' ...'; } else { $ret[$key] = $value; } } return $ret; } /** * Removes first N levels from trace * * @param Array $trace * @param int $levels * @param Array $files * @return Array * @access public */ public function createTrace($trace = null, $levels = null, $files = null) { if ( !isset($trace) ) { $trace = debug_backtrace(false); } if ( !$trace ) { // no trace information return $trace; } if ( isset($levels) && is_numeric($levels) ) { for ($i = 0; $i < $levels; $i++) { array_shift($trace); } } if ( isset($files) && is_array($files) ) { $classes = array_keys($files); while ( true ) { $trace_info = $trace[0]; $file = isset($trace_info['file']) ? basename($trace_info['file']) : ''; $class = isset($trace_info['class']) ? $trace_info['class'] : ''; if ( ($file && !in_array($file, $files)) || ($class && !in_array($class, $classes)) ) { break; } array_shift($trace); } } return $trace; } /** * Adds PHP error to log record * * @param int $errno * @param string $errstr * @param string $errfile * @param int $errline * @return kLogger * @access public */ public function addError($errno, $errstr, $errfile = null, $errline = null) { $errstr = self::expandMessage($errstr, !$this->_debugMode); $this->_logRecord['LogLevel'] = $this->_getLogLevelByErrorNo($errno); if ( $this->isLogType(self::LT_DATABASE, $errstr) ) { list ($errno, $errstr, $sql) = self::parseDatabaseError($errstr); $this->_logRecord['LogType'] = self::LT_DATABASE; $this->_logRecord['LogUserData'] = $sql; $trace = $this->createTrace(null, 4, $this->_ignoreInTrace); $this->addSource($trace); $this->addTrace($trace, 0); } else { $this->_logRecord['LogType'] = self::LT_PHP; $this->addSource((string)$errfile, $errline); $this->addTrace(null, 4); } $this->_logRecord['LogCode'] = $errno; $this->_logRecord['LogMessage'] = $errstr; return $this; } /** * Adds PHP exception to log record * * @param Exception $exception * @return kLogger * @access public */ public function addException($exception) { $errstr = self::expandMessage($exception->getMessage(), !$this->_debugMode); $this->_logRecord['LogLevel'] = self::LL_CRITICAL; $exception_trace = $exception->getTrace(); array_unshift($exception_trace, array( 'function' => '', 'file' => $exception->getFile() !== null ? $exception->getFile() : 'n/a', 'line' => $exception->getLine() !== null ? $exception->getLine() : 'n/a', 'args' => array(), )); if ( $this->isLogType(self::LT_DATABASE, $errstr) ) { list ($errno, $errstr, $sql) = self::parseDatabaseError($errstr); $this->_logRecord['LogType'] = self::LT_DATABASE; $this->_logRecord['LogUserData'] = $sql; $trace = $this->createTrace($exception_trace, null, $this->_ignoreInTrace); $this->addSource($trace); $this->addTrace($trace, 0); } else { $this->_logRecord['LogType'] = self::LT_PHP; $errno = $exception->getCode(); $this->addSource((string)$exception->getFile(), $exception->getLine()); $this->addTrace($exception_trace, 0); } $this->_logRecord['LogCode'] = $errno; $this->_logRecord['LogMessage'] = $errstr; return $this; } /** * Allows to map PHP error numbers to syslog log level * * @param int $errno * @return int * @access protected */ protected function _getLogLevelByErrorNo($errno) { $error_number_mapping = Array ( self::LL_ERROR => Array (E_RECOVERABLE_ERROR, E_USER_ERROR, E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE), self::LL_WARNING => Array (E_WARNING, E_USER_WARNING, E_CORE_WARNING, E_COMPILE_WARNING), self::LL_NOTICE => Array (E_NOTICE, E_USER_NOTICE, E_STRICT), ); if ( version_compare(PHP_VERSION, '5.3.0', '>=') ) { $error_number_mapping[self::LL_NOTICE][] = E_DEPRECATED; $error_number_mapping[self::LL_NOTICE][] = E_USER_DEPRECATED; } foreach ($error_number_mapping as $log_level => $error_numbers) { if ( in_array($errno, $error_numbers) ) { return $log_level; } } return self::LL_ERROR; } /** * Changes log level of a log record * * @param int $log_level * @return kLogger * @access public */ public function setLogLevel($log_level) { $this->_logRecord['LogLevel'] = $log_level; return $this; } /** * Writes prepared log to database or disk, when database isn't available * - * @param int $storage_medium - * @return bool|int - * @access public - * @throws InvalidArgumentException + * @param integer $storage_medium Storage medium. + * @param boolean $check_origin Check error origin. + * + * @return integer|boolean + * @throws InvalidArgumentException When unknown storage medium is given. */ - public function write($storage_medium = self::LS_AUTOMATIC) + public function write($storage_medium = self::LS_AUTOMATIC, $check_origin = false) { - if ( !$this->_logRecord || $this->_logRecord['LogLevel'] > $this->_maxLogLevel || $this->_state == self::STATE_DISABLED ) { - // nothing to save OR less detailed logging requested OR disabled + if ( $check_origin && isset($this->_logRecord['LogSourceFilename']) ) { + $origin_allowed = self::isErrorOriginAllowed($this->_logRecord['LogSourceFilename']); + } + else { + $origin_allowed = true; + } + + if ( !$this->_logRecord + || $this->_logRecord['LogLevel'] > $this->_maxLogLevel + || !$origin_allowed + || $this->_state == self::STATE_DISABLED + ) { + // Nothing to save OR less detailed logging requested OR origin not allowed OR disabled. + $this->_logRecord = array(); + return false; } $this->_logRecord['LogMemoryUsed'] = memory_get_usage(); $this->_logRecord['LogTimestamp'] = time(); $this->_logRecord['LogDate'] = date('Y-m-d H:i:s'); if ( $storage_medium == self::LS_AUTOMATIC ) { $storage_medium = $this->Conn->connectionOpened() ? self::LS_DATABASE : self::LS_DISK; } if ( $storage_medium == self::LS_DATABASE ) { $result = $this->Conn->doInsert($this->_logRecord, TABLE_PREFIX . 'SystemLog'); } elseif ( $storage_medium == self::LS_DISK ) { $result = $this->_saveToFile(RESTRICTED . '/system.log'); } else { throw new InvalidArgumentException('Unknown storage medium "' . $storage_medium . '"'); } $unique_id = $this->_logRecord['LogUniqueId']; if ( $this->_logRecord['LogNotificationStatus'] == self::LNS_SENT ) { $this->_sendNotification($unique_id); } $this->_logRecord = Array (); return $result ? $unique_id : false; } /** * Catches last error happened before script ended * * @return void * @access public */ public function catchLastError() { $this->write(); $last_error = error_get_last(); if ( !is_null($last_error) && isset($this->_handlers[self::LL_ERROR]) ) { /** @var kErrorHandlerStack $handler */ $handler = $this->_handlers[self::LL_ERROR]; $handler->handle($last_error['type'], $last_error['message'], $last_error['file'], $last_error['line']); } } /** * Deletes log with given id from database or disk, when database isn't available * * @param int $unique_id * @param int $storage_medium * @return void * @access public * @throws InvalidArgumentException */ public function delete($unique_id, $storage_medium = self::LS_AUTOMATIC) { if ( $storage_medium == self::LS_AUTOMATIC ) { $storage_medium = $this->Conn->connectionOpened() ? self::LS_DATABASE : self::LS_DISK; } if ( $storage_medium == self::LS_DATABASE ) { $sql = 'DELETE FROM ' . TABLE_PREFIX . 'SystemLog WHERE LogUniqueId = ' . $unique_id; $this->Conn->Query($sql); } elseif ( $storage_medium == self::LS_DISK ) { // TODO: no way to delete a line from a file } else { throw new InvalidArgumentException('Unknown storage medium "' . $storage_medium . '"'); } } /** * Send notification (delayed or instant) about log record to e-mail from configuration * * @param bool $instant * @return kLogger * @access public */ public function notify($instant = false) { $this->_logRecord['LogNotificationStatus'] = $instant ? self::LNS_SENT : self::LNS_PENDING; return $this; } /** * Sends notification e-mail about message with given $unique_id * * @param int $unique_id * @return void * @access protected */ protected function _sendNotification($unique_id) { $notification_email = $this->Application->ConfigValue('SystemLogNotificationEmail'); if ( !$notification_email ) { trigger_error('System Log notification E-mail not specified', E_USER_NOTICE); return; } $send_params = Array ( 'to_name' => $notification_email, 'to_email' => $notification_email, ); // initialize list outside of e-mail event with right settings $this->Application->recallObject('system-log.email', 'system-log_List', Array ('unique_id' => $unique_id)); $this->Application->emailAdmin('SYSTEM.LOG.NOTIFY', null, $send_params); $this->Application->removeObject('system-log.email'); } /** * Adds error/exception handler * * @param string|Array $handler * @param bool $is_exception * @return void * @access public */ public function addErrorHandler($handler, $is_exception = false) { $this->_handlers[$is_exception ? self::LL_CRITICAL : self::LL_ERROR]->add($handler); } /** * SQL Error Handler * * When not debug mode, then fatal database query won't break anything. * * @param int $code * @param string $msg * @param string $sql * @return bool * @access public * @throws RuntimeException */ public function handleSQLError($code, $msg, $sql) { $error_msg = self::shortenMessage(self::DB_ERROR_PREFIX . ' #' . $code . ' - ' . $msg . '. SQL: ' . trim($sql)); if ( isset($this->Application->Debugger) ) { if ( kUtil::constOn('DBG_SQL_FAILURE') && !defined('IS_INSTALL') ) { throw new RuntimeException($error_msg); } else { $this->Application->Debugger->appendTrace(); } } // next line also trigger attached error handlers trigger_error($error_msg, E_USER_WARNING); return true; } /** * Packs information about error into a single line * * @param string $errno * @param bool $strip_tags * @return string * @access public */ public function toString($errno = null, $strip_tags = false) { if ( !isset($errno) ) { $errno = $this->_logRecord['LogCode']; } $errstr = $this->_logRecord['LogMessage']; $errfile = $this->_logRecord['LogSourceFilename']; $errline = $this->_logRecord['LogSourceFileLine']; if ( PHP_SAPI === 'cli' ) { $result = sprintf(' [%s] ' . PHP_EOL . ' %s', $errno, $errstr); if ( $this->_logRecord['LogBacktrace'] ) { $result .= $this->printBacktrace(unserialize($this->_logRecord['LogBacktrace'])); } } else { $result = '' . $errno . ': ' . "{$errstr} in {$errfile} on line {$errline}"; } return $strip_tags ? strip_tags($result) : $result; } /** * Prints backtrace result * * @param array $trace Trace. * * @return string */ protected function printBacktrace(array $trace) { if ( !$trace ) { return ''; } $ret = PHP_EOL . PHP_EOL . PHP_EOL . 'Exception trace:' . PHP_EOL; foreach ( $trace as $trace_info ) { $class = isset($trace_info['class']) ? $trace_info['class'] : ''; $type = isset($trace_info['type']) ? $trace_info['type'] : ''; $function = $trace_info['function']; $args = isset($trace_info['args']) && $trace_info['args'] ? '...' : ''; $file = isset($trace_info['file']) ? $trace_info['file'] : 'n/a'; $line = isset($trace_info['line']) ? $trace_info['line'] : 'n/a'; $ret .= sprintf(' %s%s%s(%s) at %s:%s' . PHP_EOL, $class, $type, $function, $args, $file, $line); } return $ret; } /** * Saves log to file (e.g. when not possible to save into database) * * @param $filename * @return bool * @access protected */ protected function _saveToFile($filename) { $time = date('Y-m-d H:i:s'); $log_file = new SplFileObject($filename, 'a'); return $log_file->fwrite('[' . $time . '] #' . $this->toString(null, true) . PHP_EOL) > 0; } /** * Checks if log type of current log record matches given one * * @param int $log_type * @param string $log_message * @return bool * @access public */ public function isLogType($log_type, $log_message = null) { if ( $this->_logRecord['LogType'] == $log_type ) { return true; } if ( $log_type == self::LT_DATABASE ) { if ( !isset($log_message) ) { $log_message = $this->_logRecord['LogMessage']; } return strpos($log_message, self::DB_ERROR_PREFIX) !== false; } return false; } /** * Shortens message * * @param string $message * @return string * @access public */ public static function shortenMessage($message) { $max_len = ini_get('log_errors_max_len'); if ( strlen($message) > $max_len ) { $long_key = kUtil::generateId(); self::$_longMessages[$long_key] = $message; return mb_substr($message, 0, $max_len - strlen($long_key) - 2) . ' #' . $long_key; } return $message; } /** * Expands shortened message * * @param string $message * @param bool $clear_cache Allow debugger to expand message after it's been expanded by kLogger * @return string * @access public */ public static function expandMessage($message, $clear_cache = true) { if ( preg_match('/(.*)#([\d]+)$/', $message, $regs) ) { $long_key = $regs[2]; if ( isset(self::$_longMessages[$long_key]) ) { $message = self::$_longMessages[$long_key]; if ( $clear_cache ) { unset(self::$_longMessages[$long_key]); } } } return $message; } /** + * Determines if error should be logged based on it's origin. + * + * @param string $file File. + * + * @return boolean + */ + public static function isErrorOriginAllowed($file) + { + static $error_origin_regexp; + + // Lazy detect error origins, because they're not available at construction time. + if ( !$error_origin_regexp ) { + $error_origins = array(); + $application = kApplication::Instance(); + + foreach ( $application->ModuleInfo as $module_info ) { + $error_origins[] = preg_quote(rtrim($module_info['Path'], '/'), '/'); + } + + $error_origins = array_unique($error_origins); + $error_origin_regexp = '/^' . preg_quote(FULL_PATH, '/') . '\/(' . implode('|', $error_origins) . ')\//'; + } + + // Allow dynamically generated code. + if ( strpos($file, 'eval()\'d code') !== false ) { + return true; + } + + // Allow known modules. + if ( preg_match('/^' . preg_quote(MODULES_PATH, '/') . '\//', $file) ) { + return preg_match($error_origin_regexp, $file) == 1; + } + + // Don't allow Vendors. + if ( preg_match('/^' . preg_quote(FULL_PATH, '/') . '\/vendor\//', $file) ) { + return false; + } + + // Allow everything else within main folder. + return preg_match('/^' . preg_quote(FULL_PATH, '/') . '\//', $file) == 1; + } + + /** * Parses database error message into error number, error message and sql that caused that error * * @static * @param string $message * @return Array * @access public */ public static function parseDatabaseError($message) { $regexp = '/' . preg_quote(self::DB_ERROR_PREFIX) . ' #(.*?) - (.*?)\. SQL: (.*?)$/s'; if ( preg_match($regexp, $message, $regs) ) { // errno, errstr, sql return Array ($regs[1], $regs[2], $regs[3]); } return Array (0, $message, ''); } } /** * Base class for error or exception handling */ abstract class kHandlerStack extends kBase { /** * List of added handlers * * @var Array * @access protected */ protected $_handlers = Array (); /** * Reference to event log, which created this object * * @var kLogger * @access protected */ protected $_logger; /** * Remembers if handler is activated * * @var bool * @access protected */ protected $_enabled = false; public function __construct(kLogger $logger) { parent::__construct(); $this->_logger = $logger; if ( !kUtil::constOn('DBG_ZEND_PRESENT') ) { $this->attach(); $this->_enabled = true; } } /** * Detaches from error handling routines on class destruction * * @return void * @access public */ public function __destruct() { if ( !$this->_enabled ) { return; } $this->detach(); $this->_enabled = false; } /** * Attach to error handling routines * * @abstract * @return void * @access protected */ abstract protected function attach(); /** * Detach from error handling routines * * @abstract * @return void * @access protected */ abstract protected function detach(); /** * Adds new handler to the stack * * @param callable $handler * @return void * @access public */ public function add($handler) { $this->_handlers[] = $handler; } + /** + * Returns `true`, when no other error handlers should process this error. + * + * @param integer $errno Error code. + * + * @return boolean + */ protected function _handleFatalError($errno) { $debug_mode = defined('DEBUG_MODE') && DEBUG_MODE; $skip_reporting = defined('DBG_SKIP_REPORTING') && DBG_SKIP_REPORTING; if ( !$this->_handlers || ($debug_mode && $skip_reporting) ) { // when debugger absent OR it's present, but we actually can't see it's error report (e.g. during ajax request) if ( $this->_isFatalError($errno) ) { $this->_displayFatalError($errno); } if ( !$this->_handlers ) { return true; } } - return null; + return false; } /** * Determines if given error is a fatal * * @abstract * @param Exception|int $errno * @return bool */ abstract protected function _isFatalError($errno); /** * Displays div with given error message * * @param string $errno * @return void * @access protected */ protected function _displayFatalError($errno) { $errno = $this->_getFatalErrorTitle($errno); $margin = $this->Application->isAdmin ? '8px' : 'auto'; $error_msg = $this->_logger->toString($errno, PHP_SAPI === 'cli'); if ( PHP_SAPI === 'cli' ) { echo $error_msg; } else { echo '
' . $error_msg . '
'; } exit; } /** * Returns title to show for a fatal * * @abstract * @param Exception|int $errno * @return string */ abstract protected function _getFatalErrorTitle($errno); } /** * Class, that handles errors */ class kErrorHandlerStack extends kHandlerStack { /** * Attach to error handling routines * * @return void * @access protected */ protected function attach() { // set as error handler $error_handler = set_error_handler(Array ($this, 'handle')); if ( $error_handler ) { // wrap around previous error handler, if any was set $this->_handlers[] = $error_handler; } } /** * Detach from error handling routines * * @return void * @access protected */ protected function detach() { restore_error_handler(); } /** * Determines if given error is a fatal * * @param int $errno * @return bool * @access protected */ protected function _isFatalError($errno) { $fatal_errors = Array (E_USER_ERROR, E_RECOVERABLE_ERROR, E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE); return in_array($errno, $fatal_errors); } /** * Returns title to show for a fatal * * @param int $errno * @return string * @access protected */ protected function _getFatalErrorTitle($errno) { return 'Fatal Error'; } /** * Default error handler * * @param int $errno * @param string $errstr * @param string $errfile * @param int $errline * @param Array $errcontext * @return bool * @access public */ public function handle($errno, $errstr, $errfile = null, $errline = null, $errcontext = Array ()) { $log = $this->_logger->prepare()->addError($errno, $errstr, $errfile, $errline); if ( $this->_handleFatalError($errno) ) { - $log->write(); + $log->write(kLogger::LS_AUTOMATIC, !$this->_isFatalError($errno)); return true; } - $log->write(); + $log->write(kLogger::LS_AUTOMATIC, !$this->_isFatalError($errno)); $res = false; foreach ($this->_handlers as $handler) { $res = call_user_func($handler, $errno, $errstr, $errfile, $errline, $errcontext); } return $res; } } /** * Class, that handles exceptions */ class kExceptionHandlerStack extends kHandlerStack { /** * Attach to error handling routines * * @return void * @access protected */ protected function attach() { // set as exception handler $exception_handler = set_exception_handler(Array ($this, 'handle')); if ( $exception_handler ) { // wrap around previous exception handler, if any was set $this->_handlers[] = $exception_handler; } } /** * Detach from error handling routines * * @return void * @access protected */ protected function detach() { restore_exception_handler(); } /** * Determines if given error is a fatal * * @param Exception $errno * @return bool */ protected function _isFatalError($errno) { return true; } /** * Returns title to show for a fatal * * @param Exception $errno * @return string */ protected function _getFatalErrorTitle($errno) { return get_class($errno); } /** * Handles exception * * @param Exception $exception * @return bool * @access public */ public function handle($exception) { $log = $this->_logger->prepare()->addException($exception); if ( $exception instanceof kRedirectException ) { /** @var kRedirectException $exception */ $exception->run(); } if ( $this->_handleFatalError($exception) ) { $log->write(); return true; } $log->write(); $res = false; foreach ($this->_handlers as $handler) { $res = call_user_func($handler, $exception); } return $res; } } Index: branches/5.3.x/core/kernel/utility/debugger.php =================================================================== --- branches/5.3.x/core/kernel/utility/debugger.php (revision 16544) +++ branches/5.3.x/core/kernel/utility/debugger.php (revision 16545) @@ -1,2141 +1,2144 @@ = 1099511627776) { $return = round($bytes / 1024 / 1024 / 1024 / 1024, 2); $suffix = "TB"; } elseif ($bytes >= 1073741824) { $return = round($bytes / 1024 / 1024 / 1024, 2); $suffix = "GB"; } elseif ($bytes >= 1048576) { $return = round($bytes / 1024 / 1024, 2); $suffix = "MB"; } elseif ($bytes >= 1024) { $return = round($bytes / 1024, 2); $suffix = "KB"; } else { $return = $bytes; $suffix = "Byte"; } $return .= ' '.$suffix; return $return; } /** * Checks, that user IP address is within allowed range * * @param string $ip_list semi-column (by default) separated ip address list * @param string $separator ip address separator (default ";") * * @return bool */ public static function ipMatch($ip_list, $separator = ';') { if ( php_sapi_name() == 'cli' ) { return false; } $ip_match = false; $ip_addresses = $ip_list ? explode($separator, $ip_list) : Array (); $client_ip = self::getClientIp(); foreach ($ip_addresses as $ip_address) { if ( self::netMatch($ip_address, $client_ip) ) { $ip_match = true; break; } } return $ip_match; } /** * Returns the client IP address. * * @return string The client IP address * @access public */ public static function getClientIp() { if ( self::$trustProxy ) { if ( array_key_exists('HTTP_CLIENT_IP', $_SERVER) ) { return $_SERVER['HTTP_CLIENT_IP']; } if ( array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) ) { $client_ip = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); foreach ($client_ip as $ip_address) { $clean_ip_address = trim($ip_address); if ( false !== filter_var($clean_ip_address, FILTER_VALIDATE_IP) ) { return $clean_ip_address; } } return ''; } } return $_SERVER['REMOTE_ADDR']; } /** * Checks, that given ip belongs to given subnet * * @param string $network * @param string $ip * @return bool * @access public */ public static function netMatch($network, $ip) { $network = trim($network); $ip = trim($ip); if ( preg_replace('/[\d\.\/-]/', '', $network) != '' ) { $network = gethostbyname($network); } if ($network == $ip) { // comparing two ip addresses directly return true; } $d = strpos($network, '-'); if ($d !== false) { // ip address range specified $from = ip2long(trim(substr($network, 0, $d))); $to = ip2long(trim(substr($network, $d + 1))); $ip = ip2long($ip); return ($ip >= $from && $ip <= $to); } elseif (strpos($network, '/') !== false) { // single subnet specified $ip_arr = explode('/', $network); if (!preg_match("@\d*\.\d*\.\d*\.\d*@", $ip_arr[0], $matches)) { $ip_arr[0] .= '.0'; // Alternate form 194.1.4/24 } $network_long = ip2long($ip_arr[0]); $x = ip2long($ip_arr[1]); $mask = long2ip($x) == $ip_arr[1] ? $x : (0xffffffff << (32 - $ip_arr[1])); $ip_long = ip2long($ip); return ($ip_long & $mask) == ($network_long & $mask); } return false; } } /** * Main debugger class, that can be used with any In-Portal (or not) project */ class Debugger { const ROW_TYPE_ERROR = 'error'; const ROW_TYPE_WARNING = 'warning'; const ROW_TYPE_NOTICE = 'notice'; const ROW_TYPE_SQL = 'sql'; const ROW_TYPE_OTHER = 'other'; /** * Holds reference to global KernelApplication instance * * @var kApplication * @access private */ private $Application = null; /** * Stores last fatal error hash or 0, when no fatal error happened * * @var integer */ private $_fatalErrorHash = 0; private $_filterTypes = Array ('error', 'sql', 'other'); /** * Counts warnings on the page * * @var int * @access public */ public $WarningCount = 0; /** * Allows to track compile errors, like "stack-overflow" * * @var bool * @access private */ private $_compileError = false; /** * Debugger data for building report * * @var Array * @access private */ private $Data = Array (); /** * Holds information about each profiler record (start/end/description) * * @var Array * @access private */ private $ProfilerData = Array (); /** * Holds information about total execution time per profiler key (e.g. total sql time) * * @var Array * @access private */ private $ProfilerTotals = Array (); /** * Counts how much each of total types were called (e.g. total error count) * * @var Array * @access private */ private $ProfilerTotalCount = Array (); /** * Holds information about all profile points registered * * @var Array * @access private */ private $ProfilePoints = Array (); /** * Prevent recursion when processing debug_backtrace() function results * * @var Array * @access private */ private $RecursionStack = Array (); /** * Cross browser debugger report scrollbar width detection * * @var int * @access private */ private $scrollbarWidth = 0; /** * Remembers how much memory & time was spent on including files * * @var Array * @access public * @see kUtil::includeOnce */ public $IncludesData = Array (); /** * Remembers maximal include deep level * * @var int * @access public * @see kUtil::includeOnce */ public $IncludeLevel = 0; /** * Prevents report generation more then once * * @var bool * @access private */ private $_inReportPrinting = false; /** * Transparent spacer image used in case of none spacer image defined via SPACER_URL constant. * Used while drawing progress bars (memory usage, time usage, etc.) * * @var string * @access private */ private $dummyImage = ''; /** * Temporary files created by debugger will be stored here * * @var string * @access private */ private $tempFolder = ''; /** * Debug rows will be separated using this string before writing to debug file * * @var string * @access private */ private $rowSeparator = '@@'; /** * Base URL for debugger includes * * @var string * @access private */ private $baseURL = ''; /** * Sub-folder, where In-Portal is installed * * @var string * @access private */ private $basePath = ''; /** * Holds last recorded timestamp (for appendTimestamp) * * @var int * @access private */ private $LastMoment; /** * Determines, that current request is AJAX request * * @var bool * @access private */ private $_isAjax = false; /** * Data, parsed from the editor url. * * @var array */ protected $editorUrlData = array('url' => '', 'params' => array()); /** * Creates instance of debugger */ public function __construct() { global $start, $dbg_options; // check if user haven't defined DEBUG_MODE contant directly if ( defined('DEBUG_MODE') && DEBUG_MODE ) { die('error: constant DEBUG_MODE defined directly, please use $dbg_options array instead'); } if ( class_exists('kUtil') ) { DebuggerUtil::$trustProxy = kUtil::getSystemConfig()->get('TrustProxy'); } // check IP before enabling debug mode $ip_match = DebuggerUtil::ipMatch(isset($dbg_options['DBG_IP']) ? $dbg_options['DBG_IP'] : ''); if ( !$ip_match || (isset($_COOKIE['debug_off']) && $_COOKIE['debug_off']) ) { define('DEBUG_MODE', 0); return; } // debug is allowed for user, continue initialization $this->InitDebugger(); $this->profileStart('kernel4_startup', 'Startup and Initialization of kernel4', $start); $this->profileStart('script_runtime', 'Script runtime', $start); $this->LastMoment = $start; error_reporting(E_ALL & ~E_STRICT); // show errors on screen in case if not in Zend Studio debugging ini_set('display_errors', DebuggerUtil::constOn('DBG_ZEND_PRESENT') ? 0 : 1); // vertical scrollbar width differs in Firefox and other browsers $this->scrollbarWidth = $this->isGecko() ? 22 : 25; $this->appendRequest(); } /** * Set's default values to constants debugger uses * */ function InitDebugger() { global $dbg_options; unset($dbg_options['DBG_IP']); // Detect fact, that this session being debugged by Zend Studio foreach ($_COOKIE as $cookie_name => $cookie_value) { if (substr($cookie_name, 0, 6) == 'debug_') { DebuggerUtil::safeDefine('DBG_ZEND_PRESENT', 1); break; } } DebuggerUtil::safeDefine('DBG_ZEND_PRESENT', 0); // set this constant value to 0 (zero) to debug debugger using Zend Studio // set default values for debugger constants $dbg_constMap = Array ( 'DBG_USE_HIGHLIGHT' => 1, // highlight output same as php code using "highlight_string" function 'DBG_WINDOW_WIDTH' => 700, // set width of debugger window (in pixels) for better viewing large amount of debug data 'DBG_USE_SHUTDOWN_FUNC' => DBG_ZEND_PRESENT ? 0 : 1, // use shutdown function to include debugger code into output 'DBG_HANDLE_ERRORS' => DBG_ZEND_PRESENT ? 0 : 1, // handle all allowed by php (see php manual) errors instead of default handler 'DBG_DOMVIEWER' => '/temp/domviewer.html', // path to DOMViewer on website 'DOC_ROOT' => str_replace('\\', '/', realpath($_SERVER['DOCUMENT_ROOT']) ), // windows hack 'DBG_LOCAL_BASE_PATH' => 'w:', // replace DOC_ROOT in filenames (in errors) using this path 'DBG_EDITOR_URL' => 'file://%F:%L', 'DBG_SHORTCUT' => 'F12', // Defines debugger activation shortcut (any symbols or Ctrl/Alt/Shift are allowed, e.g. Ctrl+Alt+F12) ); // debugger is initialized before kHTTPQuery, so do jQuery headers check here too if (array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { $this->_isAjax = true; } elseif (array_key_exists('ajax', $_GET) && $_GET['ajax'] == 'yes') { $this->_isAjax = true; } // user defined options override debugger defaults $dbg_constMap = array_merge($dbg_constMap, $dbg_options); if ($this->_isAjax && array_key_exists('DBG_SKIP_AJAX', $dbg_constMap) && $dbg_constMap['DBG_SKIP_AJAX']) { $dbg_constMap['DBG_SKIP_REPORTING'] = 1; } // allows to validate unit configs via request variable if ( !array_key_exists('DBG_VALIDATE_CONFIGS', $dbg_constMap) ) { $dbg_constMap['DBG_VALIDATE_CONFIGS'] = array_key_exists('validate_configs', $_GET) ? (int)$_GET['validate_configs'] : 0; } // when validation configs, don't show sqls for better validation error displaying if ($dbg_constMap['DBG_VALIDATE_CONFIGS']) { $dbg_constMap['DBG_SQL_PROFILE'] = 0; } // when showing explain make shure, that debugger window is large enough if (array_key_exists('DBG_SQL_EXPLAIN', $dbg_constMap) && $dbg_constMap['DBG_SQL_EXPLAIN']) { $dbg_constMap['DBG_WINDOW_WIDTH'] = 1000; } foreach ($dbg_constMap as $dbg_constName => $dbg_constValue) { DebuggerUtil::safeDefine($dbg_constName, $dbg_constValue); } $this->parseEditorUrl(); } /** * Parses editor url. * * @return void */ protected function parseEditorUrl() { $components = parse_url(DBG_EDITOR_URL); $this->editorUrlData['url'] = $components['scheme'] . '://' . $components['host']; if ( isset($components['path']) ) { $this->editorUrlData['url'] .= $components['path']; } if ( isset($components['query']) ) { parse_str(html_entity_decode($components['query']), $this->editorUrlData['params']); } } /** * Performs debugger initialization * * @return void */ private function InitReport() { if ( !class_exists('kApplication') ) { return; } $application =& kApplication::Instance(); // string used to separate debugger records while in file (used in debugger dump filename too) $this->rowSeparator = '@' . (/*is_object($application->Factory) &&*/ $application->InitDone ? $application->GetSID() : 0) . '@'; // $this->rowSeparator = '@' . rand(0, 100000) . '@'; // include debugger files from this url $reg_exp = '/^' . preg_quote(FULL_PATH, '/') . '/'; $kernel_path = preg_replace($reg_exp, '', KERNEL_PATH, 1); $this->baseURL = PROTOCOL . SERVER_NAME . (defined('PORT') ? ':' . PORT : '') . rtrim(BASE_PATH, '/') . $kernel_path . '/utility/debugger'; // store debugger cookies at this path $this->basePath = rtrim(BASE_PATH, '/'); // save debug output in this folder $this->tempFolder = defined('RESTRICTED') ? RESTRICTED : WRITEABLE . '/cache'; } /** * Appends all passed variable values (without variable names) to debug output * * @return void * @access public */ public function dumpVars() { $dump_mode = 'var_dump'; $dumpVars = func_get_args(); if ( $dumpVars[count($dumpVars) - 1] === 'STRICT' ) { $dump_mode = 'strict_var_dump'; array_pop($dumpVars); } foreach ($dumpVars as $varValue) { $this->Data[] = Array ('value' => $varValue, 'debug_type' => $dump_mode); } } /** * Transforms collected data at given index into human-readable HTML to place in debugger report * * @param int $dataIndex * @return string * @access private */ private function prepareHTML($dataIndex) { static $errors_displayed = 0; $Data =& $this->Data[$dataIndex]; if ( $Data['debug_type'] == 'html' ) { return $Data['html']; } switch ($Data['debug_type']) { case 'error': $errors_displayed++; $fileLink = $this->getFileLink($Data['file'], $Data['line']); $ret = '' . $this->getErrorNameByCode($Data['no']) . ' (#' . $errors_displayed . '): ' . $Data['str']; $ret .= ' in ' . $fileLink . ' on line ' . $Data['line'] . ''; return $ret; break; case 'exception': $fileLink = $this->getFileLink($Data['file'], $Data['line']); $ret = '' . $Data['exception_class'] . ': ' . $Data['str']; $ret .= ' in ' . $fileLink . ' on line ' . $Data['line'] . ''; return $ret; break; case 'var_dump': return $this->highlightString($this->print_r($Data['value'], true)); break; case 'strict_var_dump': return $this->highlightString(var_export($Data['value'], true)); break; case 'trace': ini_set('memory_limit', '500M'); $trace =& $Data['trace']; $i = 0; $traceCount = count($trace); $ret = ''; while ( $i < $traceCount ) { $traceRec =& $trace[$i]; $argsID = 'trace_args_' . $dataIndex . '_' . $i; $has_args = isset($traceRec['args']); if ( isset($traceRec['file']) ) { $func_name = isset($traceRec['class']) ? $traceRec['class'] . $traceRec['type'] . $traceRec['function'] : $traceRec['function']; $args_link = $has_args ? 'Function' : 'Function'; $ret .= $args_link . ': ' . $this->getFileLink($traceRec['file'], $traceRec['line'], $func_name); $ret .= ' in ' . basename($traceRec['file']) . ' on line ' . $traceRec['line'] . '
'; } else { $ret .= 'no file information available'; } if ( $has_args ) { // if parameter value is longer then 200 symbols, then leave only first 50 $args = $this->highlightString($this->print_r($traceRec['args'], true)); $ret .= ''; } $i++; } return $ret; break; case 'profiler': $profileKey = $Data['profile_key']; $Data =& $this->ProfilerData[$profileKey]; $runtime = ($Data['ends'] - $Data['begins']); // in seconds $totals_key = getArrayValue($Data, 'totalsKey'); if ( $totals_key ) { $total_before = $Data['totalsBefore']; $total = $this->ProfilerTotals[$totals_key]; $div_width = Array (); $total_width = ($this->getWindowWidth() - 10); $div_width['before'] = round(($total_before / $total) * $total_width); $div_width['current'] = round(($runtime / $total) * $total_width); $div_width['left'] = round((($total - $total_before - $runtime) / $total) * $total_width); $subtitle = array_key_exists('subtitle', $Data) ? ' (' . $Data['subtitle'] . ')' : ''; $ret = 'Name' . $subtitle . ': ' . $Data['description'] . '
'; $additional = isset($Data['additional']) ? $Data['additional'] : Array (); if ( isset($Data['file']) ) { array_unshift($additional, Array ('name' => 'File', 'value' => $this->getFileLink($Data['file'], $Data['line'], basename($Data['file']) . ':' . $Data['line']))); } array_unshift($additional, Array ('name' => 'Runtime', 'value' => $runtime . 's')); $ret .= '
'; //FF 3.5 needs this! foreach ($additional as $mixed_param) { $ret .= '[' . $mixed_param['name'] . ': ' . $mixed_param['value'] . '] '; } /*if ( isset($Data['file']) ) { $ret .= '[Runtime: ' . $runtime . 's] [File: ' . $this->getFileLink($Data['file'], $Data['line'], basename($Data['file']) . ':' . $Data['line']) . ']
'; } else { $ret .= 'Runtime: ' . $runtime . 's
'; }*/ $ret .= '
'; $ret .= '
'; $ret .= '
'; $ret .= '
'; return $ret; } else { return 'Name: ' . $Data['description'] . '
Runtime: ' . $runtime . 's'; } break; default: return 'incorrect debug data'; break; } } /** * Returns row type for debugger row. * * @param integer $data_index Index of the row. * * @return string */ protected function getRowType($data_index) { $data = $this->Data[$data_index]; switch ($data['debug_type']) { case 'html': if ( strpos($data['html'], 'SQL Total time') !== false ) { return self::ROW_TYPE_SQL; } break; case 'error': $error_map = array( 'Fatal Error' => self::ROW_TYPE_ERROR, 'Warning' => self::ROW_TYPE_WARNING, 'Notice' => self::ROW_TYPE_NOTICE, + 'Deprecation Notice' => self::ROW_TYPE_NOTICE, ); return $error_map[$this->getErrorNameByCode($data['no'])]; break; case 'exception': return self::ROW_TYPE_ERROR; break; case 'profiler': if ( preg_match('/^sql_/', $data['profile_key']) ) { return self::ROW_TYPE_SQL; } break; } return self::ROW_TYPE_OTHER; } /** * Returns debugger report window width excluding scrollbar * * @return int * @access private */ private function getWindowWidth() { return DBG_WINDOW_WIDTH - $this->scrollbarWidth - 8; } /** * Tells debugger to skip objects that are heavy in plan of memory usage while printing debug_backtrace results * * @param Object $object * @return bool * @access private */ private function IsBigObject(&$object) { $skip_classes = Array( defined('APPLICATION_CLASS') ? APPLICATION_CLASS : 'kApplication', 'kFactory', 'kUnitConfigReader', 'NParser', ); foreach ($skip_classes as $class_name) { if ( strtolower(get_class($object)) == strtolower($class_name) ) { return true; } } return false; } /** * Advanced version of print_r (for debugger only). Don't print objects recursively. * * @param mixed $p_array Value to be printed. * @param boolean $return_output Return output or print it out. * @param integer $tab_count Offset in tabs. * * @return string */ private function print_r(&$p_array, $return_output = false, $tab_count = -1) { static $first_line = true; // not an array at all if ( !is_array($p_array) ) { switch ( gettype($p_array) ) { case 'NULL': return 'NULL' . "\n"; break; case 'object': return $this->processObject($p_array, $tab_count); break; case 'resource': return (string)$p_array . "\n"; break; default: // number or string if ( strlen($p_array) > 200 ) { $p_array = substr($p_array, 0, 50) . ' ...'; } return $p_array . "\n"; break; } } $output = ''; if ( count($p_array) > 50 ) { $array = array_slice($p_array, 0, 50); $array[] = '...'; } else { $array = $p_array; } $tab_count++; $output .= "Array\n" . str_repeat(' ', $tab_count) . "(\n"; $tab_count++; $tabsign = $tab_count ? str_repeat(' ', $tab_count) : ''; $array_keys = array_keys($array); foreach ($array_keys as $key) { switch ( gettype($array[$key]) ) { case 'array': $output .= $tabsign . '[' . $key . '] = ' . $this->print_r($array[$key], true, $tab_count); break; case 'boolean': $output .= $tabsign . '[' . $key . '] = ' . ($array[$key] ? 'true' : 'false') . "\n"; break; case 'integer': case 'double': case 'string': if ( strlen($array[$key]) > 200 ) { $array[$key] = substr($array[$key], 0, 50) . ' ...'; } $output .= $tabsign . '[' . $key . '] = ' . $array[$key] . "\n"; break; case 'NULL': $output .= $tabsign . '[' . $key . "] = NULL\n"; break; case 'object': $output .= $tabsign . '[' . $key . "] = "; $output .= "Object (" . get_class($array[$key]) . ") = \n" . str_repeat(' ', $tab_count + 1) . "(\n"; $output .= $this->processObject($array[$key], $tab_count + 2); $output .= str_repeat(' ', $tab_count + 1) . ")\n"; break; default: $output .= $tabsign . '[' . $key . '] unknown = ' . gettype($array[$key]) . "\n"; break; } } $tab_count--; $output .= str_repeat(' ', $tab_count) . ")\n"; if ( $first_line ) { $first_line = false; $output .= "\n"; } $tab_count--; if ( $return_output ) { return $output; } else { echo $output; } return true; } /** * Returns string representation of given object (more like print_r, but with recursion prevention check) * * @param Object $object * @param int $tab_count * @return string * @access private */ private function processObject(&$object, $tab_count) { $object_class = get_class($object); if ( !in_array($object_class, $this->RecursionStack) ) { if ( $this->IsBigObject($object) ) { return 'SKIPPED (class: ' . $object_class . ")\n"; } $attribute_names = get_class_vars($object_class); if ( !$attribute_names ) { return "NO_ATTRIBUTES\n"; } else { $output = ''; array_push($this->RecursionStack, $object_class); $tabsign = $tab_count ? str_repeat(' ', $tab_count) : ''; foreach ($attribute_names as $attribute_name => $attribute_value) { if ( is_object($object->$attribute_name) ) { // it is object $output .= $tabsign . '[' . $attribute_name . '] = ' . $this->processObject($object->$attribute_name, $tab_count + 1); } else { $output .= $tabsign . '[' . $attribute_name . '] = ' . $this->print_r($object->$attribute_name, true, $tab_count); } } array_pop($this->RecursionStack); return $output; } } else { // object [in recursion stack] return '*** RECURSION *** (class: ' . $object_class . ")\n"; } } /** * Format SQL Query using predefined formatting * and highlighting techniques * * @param string $sql * @return string * @access public */ public function formatSQL($sql) { $sql = trim(preg_replace('/(\n|\t| )+/is', ' ', $sql)); // whitespace in the beginning of the regex is to avoid splitting inside words, for example "FROM int_ConfigurationValues" into "FROM intConfiguration\n\tValues" $formatted_sql = preg_replace('/\s(CREATE TABLE|DROP TABLE|SELECT|UPDATE|SET|REPLACE|INSERT|DELETE|VALUES|FROM|LEFT JOIN|INNER JOIN|LIMIT|WHERE|HAVING|GROUP BY|ORDER BY)\s/is', "\n\t$1 ", ' ' . $sql); $formatted_sql = $this->highlightString($formatted_sql); if ( defined('DBG_SQL_EXPLAIN') && DBG_SQL_EXPLAIN ) { if ( substr($sql, 0, 6) == 'SELECT' ) { $formatted_sql .= '
' . 'Explain:

'; $explain_result = $this->Application->Conn->Query('EXPLAIN ' . $sql, null, true); $explain_table = ''; foreach ($explain_result as $explain_row) { if ( !$explain_table ) { // first row -> draw header $explain_table .= '' . implode('', array_keys($explain_row)) . ''; } $explain_table .= '' . implode('', $explain_row) . ''; } $formatted_sql .= '' . $explain_table . '
'; } } return $formatted_sql; } /** * Highlights given string using "highlight_string" method * * @param string $string * @return string * @access public */ public function highlightString($string) { if ( !(defined('DBG_USE_HIGHLIGHT') && DBG_USE_HIGHLIGHT) || $this->_compileError ) { return nl2br($string); } $string = str_replace(Array ('\\', '/'), Array ('_no_match_string_', '_n_m_s_'), $string); $this->_compileError = true; // next line is possible cause of compile error $string = highlight_string('', true); $this->_compileError = false; $string = str_replace(Array ('_no_match_string_', '_n_m_s_'), Array ('\\', '/'), $string); if ( strlen($string) >= 65536 ) { // preg_replace will fail, when string is longer, then 65KB return str_replace(Array ('<?php ', '?>'), '', $string); } return preg_replace('/<\?(.*)php (.*)\?>/Us', '\\2', $string); } /** * Determine by php type of browser used to show debugger * * @return bool * @access private */ private function isGecko() { // we need isset because we may run scripts from shell with no user_agent at all return isset($_SERVER['HTTP_USER_AGENT']) && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'firefox') !== false; } /** * Returns link for editing php file (from error) in external editor * * @param string $file filename with path from root folder * @param int $line_number line number in file where error is found * @param string $title text to show on file edit link * @return string * @access public */ public function getFileLink($file, $line_number = 1, $title = '') { if ( !$title ) { $title = str_replace('/', '\\', $this->getLocalFile($file)); } $local_file = $this->getLocalFile($file); $url_params = $this->editorUrlData['params']; foreach ( $url_params as $param_name => $param_value ) { $url_params[$param_name] = str_replace( array('%F', '%L'), array($local_file, $line_number), $param_value ); } $url = $this->editorUrlData['url'] . '?' . http_build_query($url_params); return '' . $title . ''; } /** * Converts filepath on server to filepath in mapped DocumentRoot on developer pc * * @param string $remoteFile * @return string * @access private */ private function getLocalFile($remoteFile) { return preg_replace('/^' . preg_quote(DOC_ROOT, '/') . '/', DBG_LOCAL_BASE_PATH, $remoteFile, 1); } /** * Appends call trace till this method call * * @param int $levels_to_shift * @return void * @access public */ public function appendTrace($levels_to_shift = 1) { $levels_shifted = 0; $trace = debug_backtrace(); while ( $levels_shifted < $levels_to_shift ) { array_shift($trace); $levels_shifted++; } $this->Data[] = Array ('trace' => $trace, 'debug_type' => 'trace'); } /** * Appends call trace till this method call * * @param Exception $exception * @return void * @access private */ private function appendExceptionTrace(&$exception) { $trace = $exception->getTrace(); $this->Data[] = Array('trace' => $trace, 'debug_type' => 'trace'); } /** * Adds memory usage statistics * * @param string $msg * @param int $used * @return void * @access public */ public function appendMemoryUsage($msg, $used = null) { if ( !isset($used) ) { $used = round(memory_get_usage() / 1024); } $this->appendHTML('Memory usage ' . $msg . ' ' . $used . 'Kb'); } /** * Appends HTML code without transformations * * @param string $html * @return void * @access public */ public function appendHTML($html) { $this->Data[] = Array ('html' => $html, 'debug_type' => 'html'); } /** * Returns instance of FirePHP class * * @return FirePHP * @link http://www.firephp.org/HQ/Use.htm */ function firePHP() { require_once('FirePHPCore/FirePHP.class.php'); return FirePHP::getInstance(true); } /** * Change debugger info that was already generated before. * Returns true if html was set. * * @param int $index * @param string $html * @param string $type = {'append','prepend','replace'} * @return bool * @access public */ public function setHTMLByIndex($index, $html, $type = 'append') { if ( !isset($this->Data[$index]) || $this->Data[$index]['debug_type'] != 'html' ) { return false; } switch ( $type ) { case 'append': $this->Data[$index]['html'] .= '
' . $html; break; case 'prepend': $this->Data[$index]['html'] = $this->Data[$index]['html'] . '
' . $html; break; case 'replace': $this->Data[$index]['html'] = $html; break; } return true; } /** * Move $debugLineCount lines of input from debug output * end to beginning. * * @param int $debugLineCount * @return void * @access private */ private function moveToBegin($debugLineCount) { $lines = array_splice($this->Data, count($this->Data) - $debugLineCount, $debugLineCount); $this->Data = array_merge($lines, $this->Data); } /** * Moves all debugger report lines after $debugLineCount into $new_row position * * @param int $new_row * @param int $debugLineCount * @return void * @access private */ private function moveAfterRow($new_row, $debugLineCount) { $lines = array_splice($this->Data, count($this->Data) - $debugLineCount, $debugLineCount); $rows_before = array_splice($this->Data, 0, $new_row, $lines); $this->Data = array_merge($rows_before, $this->Data); } /** * Appends HTTP REQUEST information to debugger report * * @return void * @access private */ private function appendRequest() { if ( isset($_SERVER['SCRIPT_FILENAME']) ) { $script = $_SERVER['SCRIPT_FILENAME']; } else { $script = $_SERVER['DOCUMENT_ROOT'] . $_SERVER['PHP_SELF']; } $this->appendHTML('ScriptName: ' . $this->getFileLink($script, 1, basename($script)) . ' (' . dirname($script) . ')'); if ( $this->_isAjax ) { $this->appendHTML('RequestURI: ' . $_SERVER['REQUEST_URI'] . ' (QS Length:' . strlen($_SERVER['QUERY_STRING']) . ')'); } $tools_html = '
' . $this->_getDomViewerHTML() . ' ' . $this->_getToolsHTML() . '
'; $this->appendHTML($tools_html); ob_start(); ?> $_GET, 'PO' => $_POST, 'CO' => $_COOKIE); foreach ($super_globals as $prefix => $data) { foreach ($data as $key => $value) { if ( !is_array($value) && trim($value) == '' ) { $value = 'no value'; } else { $value = htmlspecialchars($this->print_r($value, true), ENT_QUOTES, 'UTF-8'); } echo ''; } } ?>
SrcNameValue
' . $prefix . '' . $key . '' . $value . '
appendHTML(ob_get_contents()); ob_end_clean(); } /** * Appends php session content to debugger output * * @return void * @access private */ private function appendSession() { if ( isset($_SESSION) && $_SESSION ) { $this->appendHTML('PHP Session: [' . ini_get('session.name') . ']'); $this->dumpVars($_SESSION); $this->moveToBegin(2); } } /** * Starts profiling of a given $key * * @param string $key * @param string $description * @param int $timeStamp * @return void * @access public */ public function profileStart($key, $description = null, $timeStamp = null) { if ( !isset($timeStamp) ) { $timeStamp = microtime(true); } $this->ProfilerData[$key] = Array ('begins' => $timeStamp, 'ends' => 5000, 'debuggerRowID' => count($this->Data)); if ( isset($description) ) { $this->ProfilerData[$key]['description'] = $description; } if ( substr($key, 0, 4) == 'sql_' ) { // append place from what was called $trace_results = debug_backtrace(); $trace_count = count($trace_results); $i = 0; while ( $i < $trace_count ) { if ( !isset($trace_results[$i]['file']) ) { $i++; continue; } $trace_file = basename($trace_results[$i]['file']); if ( $trace_file != 'db_connection.php' && $trace_file != 'db_load_balancer.php' && $trace_file != 'adodb.inc.php' ) { break; } $i++; } $this->ProfilerData[$key]['file'] = $trace_results[$i]['file']; $this->ProfilerData[$key]['line'] = $trace_results[$i]['line']; if ( isset($trace_results[$i + 1]['object']) && isset($trace_results[$i + 1]['object']->Prefix) ) { /** @var kBase $object */ $object =& $trace_results[$i + 1]['object']; $prefix_special = rtrim($object->Prefix . '.' . $object->Special, '.'); $this->ProfilerData[$key]['prefix_special'] = $prefix_special; } unset($trace_results); } $this->Data[] = Array ('profile_key' => $key, 'debug_type' => 'profiler'); } /** * Ends profiling for a given $key * * @param string $key * @param string $description * @param int $timeStamp * @return void * @access public */ public function profileFinish($key, $description = null, $timeStamp = null) { if ( !isset($timeStamp) ) { $timeStamp = microtime(true); } $this->ProfilerData[$key]['ends'] = $timeStamp; if ( isset($description) ) { $this->ProfilerData[$key]['description'] = $description; } if ( substr($key, 0, 4) == 'sql_' ) { $func_arguments = func_get_args(); $rows_affected = $func_arguments[3]; $additional = Array (); if ( $rows_affected > 0 ) { $additional[] = Array ('name' => 'Affected Rows', 'value' => $rows_affected); if ( isset($func_arguments[4]) ) { if ( strlen($func_arguments[4]) > 200 ) { $func_arguments[4] = substr($func_arguments[4], 0, 50) . ' ...'; } $additional[] = Array ('name' => 'Result', 'value' => $func_arguments[4]); } } $additional[] = Array ('name' => 'Query Number', 'value' => $func_arguments[5]); if ( $func_arguments[6] ) { $this->profilerAddTotal('cachable_queries', $key); $this->ProfilerData[$key]['subtitle'] = 'cachable'; } if ( (string)$func_arguments[7] !== '' ) { $additional[] = Array ('name' => 'Server #', 'value' => $func_arguments[7]); } if ( array_key_exists('prefix_special', $this->ProfilerData[$key]) ) { $additional[] = Array ('name' => 'PrefixSpecial', 'value' => $this->ProfilerData[$key]['prefix_special']); } $this->ProfilerData[$key]['additional'] =& $additional; } } /** * Collects total execution time from profiler record * * @param string $total_key * @param string $key * @param int $value * @return void * @access public */ public function profilerAddTotal($total_key, $key = null, $value = null) { if ( !isset($this->ProfilerTotals[$total_key]) ) { $this->ProfilerTotals[$total_key] = 0; $this->ProfilerTotalCount[$total_key] = 0; } if ( !isset($value) ) { $value = $this->ProfilerData[$key]['ends'] - $this->ProfilerData[$key]['begins']; } if ( isset($key) ) { $this->ProfilerData[$key]['totalsKey'] = $total_key; $this->ProfilerData[$key]['totalsBefore'] = $this->ProfilerTotals[$total_key]; } $this->ProfilerTotals[$total_key] += $value; $this->ProfilerTotalCount[$total_key]++; } /** * Traces relative code execution speed between this method calls * * @param string $message * @return void * @access public */ public function appendTimestamp($message) { global $start; $time = microtime(true); $from_last = $time - $this->LastMoment; $from_start = $time - $start; $this->appendHTML(sprintf("%s %.5f from last %.5f from start", $message, $from_last, $from_start)); $this->LastMoment = $time; } /** * Returns unique ID for each method call * * @return int * @access public */ public function generateID() { list($usec, $sec) = explode(' ', microtime()); $id_part_1 = substr($usec, 4, 4); $id_part_2 = mt_rand(1, 9); $id_part_3 = substr($sec, 6, 4); $digit_one = substr($id_part_1, 0, 1); if ( $digit_one == 0 ) { $digit_one = mt_rand(1, 9); $id_part_1 = preg_replace('/^0/', '', $id_part_1); $id_part_1 = $digit_one . $id_part_1; } return $id_part_1 . $id_part_2 . $id_part_3; } /** * Returns error name based on it's code * * @param int $error_code * @return string * @access private */ private function getErrorNameByCode($error_code) { $error_map = Array ( 'Fatal Error' => Array (E_RECOVERABLE_ERROR, E_USER_ERROR, E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE), 'Warning' => Array (E_WARNING, E_USER_WARNING, E_CORE_WARNING, E_COMPILE_WARNING), 'Notice' => Array (E_NOTICE, E_USER_NOTICE, E_STRICT), ); if ( defined('E_DEPRECATED') ) { - // since PHP 5.3 - $error_map['Notice'][] = E_DEPRECATED; - $error_map['Notice'][] = E_USER_DEPRECATED; + // Since PHP 5.3. + $error_map['Deprecation Notice'] = array(E_DEPRECATED, E_USER_DEPRECATED); } foreach ($error_map as $error_name => $error_codes) { if ( in_array($error_code, $error_codes) ) { return $error_name; } } return ''; } /** * Returns profile total key (check against missing key too) * * @param string $key * @return int * @access private */ private function getProfilerTotal($key) { if ( isset($this->ProfilerTotalCount[$key]) ) { return (int)$this->ProfilerTotalCount[$key]; } return 0; } /** * Counts how much calls were made to a place, where this method is called (basic version of profiler) * * @param string $title * @param int $level * @return void * @access public */ public function ProfilePoint($title, $level = 1) { $trace_results = debug_backtrace(); $level = min($level, count($trace_results) - 1); do { $point = $trace_results[$level]; $location = $point['file'] . ':' . $point['line']; $level++; $has_more = isset($trace_results[$level]); } while ( $has_more && $point['function'] == $trace_results[$level]['function'] ); if ( !isset($this->ProfilePoints[$title]) ) { $this->ProfilePoints[$title] = Array (); } if ( !isset($this->ProfilePoints[$title][$location]) ) { $this->ProfilePoints[$title][$location] = 0; } $this->ProfilePoints[$title][$location]++; } /** * Generates report * * @param boolean $return_result Returns or output report contents. * @param boolean $clean_output_buffer Clean output buffers before displaying anything. * @param boolean $is_shutdown_func Called from shutdown function. * * @return string */ public function printReport($return_result = false, $clean_output_buffer = true, $is_shutdown_func = false) { if ( $this->_inReportPrinting ) { // don't print same report twice (in case if shutdown function used + compression + fatal error) return ''; } $this->_inReportPrinting = true; $last_error = error_get_last(); if ( !is_null($last_error) && $is_shutdown_func ) { $this->saveError( $last_error['type'], $last_error['message'], $last_error['file'], $last_error['line'], null, $is_shutdown_func ); } $this->profileFinish('script_runtime'); $this->_breakOutOfBuffering(!$return_result); $debugger_start = memory_get_usage(); if ( defined('SPACER_URL') ) { $this->dummyImage = SPACER_URL; } $this->InitReport(); // set parameters required by AJAX // defined here, because user can define this constant while script is running, not event before debugger is started DebuggerUtil::safeDefine('DBG_RAISE_ON_WARNINGS', 0); DebuggerUtil::safeDefine('DBG_TOOLBAR_BUTTONS', 1); $this->appendSession(); // show php session if any // ensure, that 1st line of debug output always is this one: $top_line = '
[Reload Frame] [Hide Debugger] [Clear Debugger][Current Time: ' . date('H:i:s') . '] [File Size: #DBG_FILESIZE#]
' . $this->getFilterDropdown() . '
'; $this->appendHTML($top_line); $this->moveToBegin(1); if ( count($this->ProfilePoints) > 0 ) { foreach ($this->ProfilePoints as $point => $locations) { arsort($this->ProfilePoints[$point]); } $this->appendHTML($this->highlightString($this->print_r($this->ProfilePoints, true))); } if ( DebuggerUtil::constOn('DBG_SQL_PROFILE') && isset($this->ProfilerTotals['sql']) ) { // sql query profiling was enabled -> show totals if ( array_key_exists('cachable_queries', $this->ProfilerTotalCount) ) { $append = ' Cachable queries: ' . $this->ProfilerTotalCount['cachable_queries']; } else { $append = ''; } $this->appendHTML('SQL Total time: ' . $this->ProfilerTotals['sql'] . ' Number of queries: ' . $this->ProfilerTotalCount['sql'] . $append); } if ( DebuggerUtil::constOn('DBG_PROFILE_INCLUDES') && isset($this->ProfilerTotals['includes']) ) { // included file profiling was enabled -> show totals $this->appendHTML('Included Files Total time: ' . $this->ProfilerTotals['includes'] . ' Number of includes: ' . $this->ProfilerTotalCount['includes']); } if ( DebuggerUtil::constOn('DBG_PROFILE_MEMORY') ) { // detailed memory usage reporting by objects was enabled -> show totals $this->appendHTML('Memory used by Objects: ' . round($this->ProfilerTotals['objects'] / 1024, 2) . 'Kb'); } if ( DebuggerUtil::constOn('DBG_INCLUDED_FILES') ) { $files = get_included_files(); $this->appendHTML('Included files:'); foreach ($files as $file) { $this->appendHTML($this->getFileLink($this->getLocalFile($file)) . ' (' . round(filesize($file) / 1024, 2) . 'Kb)'); } } if ( DebuggerUtil::constOn('DBG_PROFILE_INCLUDES') ) { $totals = $totals_configs = Array ('mem' => 0, 'time' => 0); $this->appendHTML('Included files statistics:' . (DebuggerUtil::constOn('DBG_SORT_INCLUDES_MEM') ? ' (sorted by memory usage)' : '')); if ( is_array($this->IncludesData['mem']) ) { if ( DebuggerUtil::constOn('DBG_SORT_INCLUDES_MEM') ) { array_multisort($this->IncludesData['mem'], SORT_DESC, $this->IncludesData['file'], $this->IncludesData['time'], $this->IncludesData['level']); } foreach ($this->IncludesData['file'] as $key => $file_name) { $this->appendHTML(str_repeat(' -> ', ($this->IncludesData['level'][$key] >= 0 ? $this->IncludesData['level'][$key] : 0)) . $file_name . ' Mem: ' . sprintf("%.4f Kb", $this->IncludesData['mem'][$key] / 1024) . ' Time: ' . sprintf("%.4f", $this->IncludesData['time'][$key])); if ( $this->IncludesData['level'][$key] == 0 ) { $totals['mem'] += $this->IncludesData['mem'][$key]; $totals['time'] += $this->IncludesData['time'][$key]; } elseif ( $this->IncludesData['level'][$key] == -1 ) { $totals_configs['mem'] += $this->IncludesData['mem'][$key]; $totals_configs['time'] += $this->IncludesData['time'][$key]; } } $this->appendHTML('Sub-Total classes: ' . ' Mem: ' . sprintf("%.4f Kb", $totals['mem'] / 1024) . ' Time: ' . sprintf("%.4f", $totals['time'])); $this->appendHTML('Sub-Total configs: ' . ' Mem: ' . sprintf("%.4f Kb", $totals_configs['mem'] / 1024) . ' Time: ' . sprintf("%.4f", $totals_configs['time'])); $this->appendHTML('Grand Total: ' . ' Mem: ' . sprintf("%.4f Kb", ($totals['mem'] + $totals_configs['mem']) / 1024) . ' Time: ' . sprintf("%.4f", $totals['time'] + $totals_configs['time'])); } } $skip_reporting = DebuggerUtil::constOn('DBG_SKIP_REPORTING') || DebuggerUtil::constOn('DBG_ZEND_PRESENT'); if ( ($this->_isAjax && !DebuggerUtil::constOn('DBG_SKIP_AJAX')) || !$skip_reporting ) { $debug_file = $this->tempFolder . '/debug_' . $this->rowSeparator . '.txt'; if ( file_exists($debug_file) ) { unlink($debug_file); } $i = 0; $fp = fopen($debug_file, 'a'); $lineCount = count($this->Data); while ( $i < $lineCount ) { $html = $this->prepareHTML($i); $row_type = $this->getRowType($i); fwrite($fp, json_encode(Array ('html' => $html, 'row_type' => $row_type)) . $this->rowSeparator); $i++; } fclose($fp); } if ( $skip_reporting ) { // let debugger write report and then don't output anything return ''; } $application =& kApplication::Instance(); $dbg_path = str_replace(FULL_PATH, '', $this->tempFolder); $debugger_params = Array ( 'FilterTypes' => $this->_filterTypes, 'RowSeparator' => $this->rowSeparator, 'ErrorsCount' => (int)$this->getProfilerTotal('error_handling'), 'IsFatalError' => $this->_fatalErrorHappened(), 'SQLCount' => (int)$this->getProfilerTotal('sql'), 'SQLTime' => isset($this->ProfilerTotals['sql']) ? sprintf('%.5f', $this->ProfilerTotals['sql']) : 0, 'ScriptTime' => sprintf('%.5f', $this->ProfilerData['script_runtime']['ends'] - $this->ProfilerData['script_runtime']['begins']), 'ScriptMemory' => DebuggerUtil::formatSize($this->getMemoryUsed($debugger_start)), 'Shortcut' => DBG_SHORTCUT, ); ob_start(); // the getShortReport($this->getMemoryUsed($debugger_start)); return $ret; } else { if ( !DebuggerUtil::constOn('DBG_HIDE_FULL_REPORT') ) { $this->_breakOutOfBuffering(); } elseif ( $clean_output_buffer ) { ob_clean(); } echo $this->getShortReport($this->getMemoryUsed($debugger_start)); } return ''; } function getFilterDropdown() { $filter_options = ''; foreach ( $this->_filterTypes as $filter_type ) { $filter_options .= ''; } return 'Show: '; } function getMemoryUsed($debugger_start) { if ( !isset($this->ProfilerTotals['error_handling']) ) { $memory_used = $debugger_start; $this->ProfilerTotalCount['error_handling'] = 0; } else { $memory_used = $debugger_start - $this->ProfilerTotals['error_handling']; } return $memory_used; } /** * Format's memory usage report by debugger * * @param int $memory_used * @return string * @access private */ private function getShortReport($memory_used) { if ( DebuggerUtil::constOn('DBG_TOOLBAR_BUTTONS') ) { // evenrything is in toolbar - don't duplicate return ''; } else { // toolbar not visible, then show sql & error count too $info = Array ( 'Script Runtime' => 'PROFILE:script_runtime', 'SQL\'s Runtime' => 'PROFILE_T:sql', '-' => 'SEP:-', 'Notice / Warning' => 'PROFILE_TC:error_handling', 'SQLs Count' => 'PROFILE_TC:sql', ); } $ret = ''; // 'Application:' . DebuggerUtil::formatSize($memory_used) . ' (' . $memory_used . ')'; foreach ($info as $title => $value_key) { list ($record_type, $record_data) = explode(':', $value_key, 2); switch ( $record_type ) { case 'PROFILE': // profiler totals value $Data =& $this->ProfilerData[$record_data]; $profile_time = ($Data['ends'] - $Data['begins']); // in seconds $ret .= '' . $title . ':' . sprintf('%.5f', $profile_time) . ' s'; break; case 'PROFILE_TC': // profile totals record count $record_cell = ''; if ( $record_data == 'error_handling' && $this->ProfilerTotalCount[$record_data] > 0 ) { $record_cell = ''; } $ret .= '' . $record_cell . $title . ':' . $record_cell . '' . $this->ProfilerTotalCount[$record_data] . ''; break; case 'PROFILE_T': // profile total $record_cell = ''; $total = array_key_exists($record_data, $this->ProfilerTotals) ? $this->ProfilerTotals[$record_data] : 0; $ret .= '' . $record_cell . $title . ':' . $record_cell . '' . sprintf('%.5f', $total) . ' s'; break; case 'SEP': $ret .= ''; break; } } return '
' . $ret . '
'; } /** * Detects if there was a fatal error at some point * * @return boolean */ private function _fatalErrorHappened() { return $this->_fatalErrorHash !== 0; } /** * Creates error hash * * @param string $errfile File, where error happened. * @param integer $errline Line in file, where error happened. * * @return integer */ private function _getErrorHash($errfile, $errline) { return crc32($errfile . ':' . $errline); } /** * User-defined error handler * * @param integer $errno Error code. * @param string $errstr Error message. * @param string $errfile Error file. * @param integer $errline Error line. * @param array $errcontext Error context. * @param boolean $is_shutdown_func Called from shutdown function. * * @return boolean * @throws Exception When unknown error code given. */ public function saveError( $errno, $errstr, $errfile = null, $errline = null, array $errcontext = null, $is_shutdown_func = false ) { $this->ProfilerData['error_handling']['begins'] = memory_get_usage(); $errorType = $this->getErrorNameByCode($errno); if (!$errorType) { throw new Exception('Unknown error type [' . $errno . ']'); } elseif ( substr($errorType, 0, 5) == 'Fatal' ) { $this->_fatalErrorHash = $this->_getErrorHash($errfile, $errline); $this->appendTrace(4); } + elseif ( !kLogger::isErrorOriginAllowed($errfile) ) { + return; + } $this->expandError($errstr, $errfile, $errline); $this->Data[] = Array ( 'no' => $errno, 'str' => $errstr, 'file' => $errfile, 'line' => $errline, 'context' => $errcontext, 'debug_type' => 'error' ); $this->ProfilerData['error_handling']['ends'] = memory_get_usage(); $this->profilerAddTotal('error_handling', 'error_handling'); if ($errorType == 'Warning') { $this->WarningCount++; } if ( $this->_fatalErrorHappened() && $this->_getErrorHash($errfile, $errline) === $this->_fatalErrorHash ) { // Append debugger report to data in buffer & clean buffer afterwards. echo $this->_breakOutOfBuffering(false) . $this->printReport(true); if ( !$is_shutdown_func ) { exit; } } return true; } /** * Adds exception details into debugger but don't cause fatal error * * @param Exception $exception * @return void * @access public */ public function appendException($exception) { $this->ProfilerData['error_handling']['begins'] = memory_get_usage(); $this->appendExceptionTrace($exception); $errno = $exception->getCode(); $errstr = $exception->getMessage(); $errfile = $exception->getFile(); $errline = $exception->getLine(); $this->expandError($errstr, $errfile, $errline); $this->Data[] = Array ( 'no' => $errno, 'str' => $errstr, 'file' => $errfile, 'line' => $errline, 'exception_class' => get_class($exception), 'debug_type' => 'exception' ); $this->ProfilerData['error_handling']['ends'] = memory_get_usage(); $this->profilerAddTotal('error_handling', 'error_handling'); } /** * User-defined exception handler * * @param Exception $exception * @return void * @access public */ public function saveException($exception) { $this->appendException($exception); $this->_fatalErrorHash = $this->_getErrorHash($exception->getFile(), $exception->getLine()); // Append debugger report to data in buffer & clean buffer afterwards. echo $this->_breakOutOfBuffering(false) . $this->printReport(true); } /** * Transforms short error messages into long ones * * @param string $errstr * @param string $errfile * @param int $errline * @return void * @access private */ private function expandError(&$errstr, &$errfile, &$errline) { $errstr = kLogger::expandMessage($errstr); list ($errno, $errstr, $sql) = kLogger::parseDatabaseError($errstr); if ( $errno != 0 ) { $errstr = '' . $errstr . ' (' . $errno . ')
SQL: ' . $this->formatSQL($sql); } if ( strpos($errfile, 'eval()\'d code') !== false ) { $errstr = '[EVAL, line ' . $errline . ']: ' . $errstr; $tmpStr = $errfile; $pos = strpos($tmpStr, '('); $errfile = substr($tmpStr, 0, $pos); $pos++; $errline = substr($tmpStr, $pos, strpos($tmpStr, ')', $pos) - $pos); } } /** * Break buffering in case if fatal error is happened in the middle * * @param bool $flush * @return string * @access private */ private function _breakOutOfBuffering($flush = true) { $buffer_content = Array (); while ( ob_get_level() ) { $buffer_content[] = ob_get_clean(); } $ret = implode('', array_reverse($buffer_content)); if ( $flush ) { echo $ret; flush(); } return $ret; } /** * Saves given message to "vb_debug.txt" file in DocumentRoot * * @param string $msg * @return void * @access public */ public function saveToFile($msg) { $fp = fopen($_SERVER['DOCUMENT_ROOT'] . '/vb_debug.txt', 'a'); fwrite($fp, $msg . "\n"); fclose($fp); } /** * Prints given constant values in a table * * @param mixed $constants * @return void * @access public */ public function printConstants($constants) { if ( !is_array($constants) ) { $constants = explode(',', $constants); } $constant_tpl = '%s%s'; $ret = ''; foreach ($constants as $constant_name) { $ret .= sprintf($constant_tpl, $constant_name, constant($constant_name)); } $ret .= '
'; $this->appendHTML($ret); } /** * Attaches debugger to Application * * @return void * @access public */ public function AttachToApplication() { if ( !DebuggerUtil::constOn('DBG_HANDLE_ERRORS') ) { return; } if ( class_exists('kApplication') ) { $this->Application =& kApplication::Instance(); $this->Application->Debugger = $this; } // kLogger will auto-detect these automatically // error/exception handlers registered before debugger will be removed! set_error_handler( Array ($this, 'saveError') ); set_exception_handler( Array ($this, 'saveException') ); } /** * Returns HTML for tools section * * @return string * @access private */ private function _getToolsHTML() { $html = '
System Tools:
'; return $html; } /** * Returns HTML for dom viewer section * * @return string * @access private */ private function _getDomViewerHTML() { $html = '
DomViewer:
'; return $html; } } if ( !function_exists('memory_get_usage') ) { // PHP 4.x and compiled without --enable-memory-limit option function memory_get_usage() { return -1; } } if ( !DebuggerUtil::constOn('DBG_ZEND_PRESENT') ) { $debugger = new Debugger(); } if ( DebuggerUtil::constOn('DBG_USE_SHUTDOWN_FUNC') ) { register_shutdown_function(array(&$debugger, 'printReport'), false, true, true); } } Index: branches/5.3.x/core/kernel/globals.php =================================================================== --- branches/5.3.x/core/kernel/globals.php (revision 16544) +++ branches/5.3.x/core/kernel/globals.php (revision 16545) @@ -1,1076 +1,1145 @@ $array2_value ) { if ( isset($array1[$array2_key]) ) { $array1[$array2_key] = self::array_merge_recursive($array1[$array2_key], $array2_value); } else { $array1[$array2_key] = $array2_value; } } return $array1; } /** * Prepend a reference to an element to the beginning of an array. * Renumbers numeric keys, so $value is always inserted to $array[0] * * @param $array array * @param $value mixed * @return int * @access public */ public static function array_unshift_ref(&$array, &$value) { $return = array_unshift($array,''); $array[0] =& $value; return $return; } /** * Rename key in associative array, maintaining keys order * * @param Array $array Associative Array * @param mixed $old Old key name * @param mixed $new New key name * @access public */ public static function array_rename_key(&$array, $old, $new) { $new_array = Array (); foreach ($array as $key => $val) { $new_array[ $key == $old ? $new : $key] = $val; } $array = $new_array; } /** * Same as print_r, but outputs result on screen or in debugger report (when in debug mode) * * @param Array $data * @param string $label * @param bool $on_screen * @access public */ public static function print_r($data, $label = '', $on_screen = false) { $is_debug = false; if ( class_exists('kApplication') && !$on_screen ) { $application =& kApplication::Instance(); $is_debug = $application->isDebugMode(); } if ( $is_debug && isset($application) ) { if ( $label ) { $application->Debugger->appendHTML('' . $label . ''); } $application->Debugger->dumpVars($data); } else { if ( $label ) { echo '' . $label . '
'; } echo '
', print_r($data, true), '
'; } } /** * Define constant if it was not already defined before * * @param string $const_name * @param string $const_value * @access public */ public static function safeDefine($const_name, $const_value) { if ( !defined($const_name) ) { define($const_name, $const_value); } } /** * Instantiate kSystemConfig class once and store locally * * @access public */ public static function getSystemConfig() { static $system_config; if ( !isset($system_config) ) { $system_config = new kSystemConfig(); } return $system_config; } /** * Same as "include_once", but also profiles file includes in debug mode and DBG_PROFILE_INCLUDES constant is set * * @param string $file * @access public */ public static function includeOnce($file) { global $debugger; if ( defined('DEBUG_MODE') && DEBUG_MODE && isset($debugger) && defined('DBG_PROFILE_INCLUDES') && DBG_PROFILE_INCLUDES ) { if ( in_array($file, get_included_files()) ) { return ; } global $debugger; /*$debugger->IncludeLevel++; $before_mem = memory_get_usage();*/ $debugger->ProfileStart('inc_'.crc32($file), $file); include_once($file); $debugger->ProfileFinish('inc_'.crc32($file)); $debugger->profilerAddTotal('includes', 'inc_'.crc32($file)); /*$used_mem = memory_get_usage() - $before_mem; $debugger->IncludeLevel--; $debugger->IncludesData['file'][] = str_replace(FULL_PATH, '', $file); $debugger->IncludesData['mem'][] = $used_mem; $debugger->IncludesData['time'][] = $used_time; $debugger->IncludesData['level'][] = $debugger->IncludeLevel;*/ } else { include_once($file); } } /** * Checks if given string is a serialized array * * @param string $string * @return bool * @access public */ public static function IsSerialized($string) { if ( is_array($string) ) { return false; } return preg_match('/a:([\d]+):{/', $string); } /** * Generates password of given length * * @param int $length * @return string * @access public */ public static function generatePassword($length = 10) { $pass_length = $length; $p1 = Array ('b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z'); $p2 = Array ('a','e','i','o','u'); $p3 = Array ('1','2','3','4','5','6','7','8','9'); $p4 = Array ('(','&',')',';','%'); // if you need real strong stuff // how much elements in the array // can be done with a array count but counting once here is faster $s1 = 21;// this is the count of $p1 $s2 = 5; // this is the count of $p2 $s3 = 9; // this is the count of $p3 $s4 = 5; // this is the count of $p4 // possible readable combinations $c1 = '121'; // will be like 'bab' $c2 = '212'; // will be like 'aba' $c3 = '12'; // will be like 'ab' $c4 = '3'; // will be just a number '1 to 9' if you dont like number delete the 3 //$c5 = '4'; // uncomment to active the strong stuff $comb = '4'; // the amount of combinations you made above (and did not comment out) for ($p = 0; $p < $pass_length;) { mt_srand((double)microtime() * 1000000); $strpart = mt_rand(1, $comb); // checking if the stringpart is not the same as the previous one if ($strpart != $previous) { $pass_structure .= ${'c' . $strpart}; // shortcutting the loop a bit $p = $p + mb_strlen(${'c' . $strpart}); } $previous = $strpart; } // generating the password from the structure defined in $pass_structure for ($g = 0; $g < mb_strlen($pass_structure); $g++) { mt_srand((double)microtime() * 1000000); $sel = mb_substr($pass_structure, $g, 1); $pass .= ${'p' . $sel}[ mt_rand(0,-1+${'s'.$sel}) ]; } return $pass; } /** * submits $url with $post as POST * * @param string $url * @param mixed $data * @param Array $headers * @param string $request_type * @param Array $curl_options * @return string * @access public * @deprecated */ public static function curl_post($url, $data, $headers = NULL, $request_type = 'POST', $curl_options = NULL) { $application =& kApplication::Instance(); /** @var kCurlHelper $curl_helper */ $curl_helper = $application->recallObject('CurlHelper'); if ($request_type == 'POST') { $curl_helper->SetRequestMethod(kCurlHelper::REQUEST_METHOD_POST); } $curl_helper->SetRequestData($data); if (!is_null($headers)) { // not an associative array, so don't use kCurlHelper::SetHeaders method $curl_helper->setOptions( Array (CURLOPT_HTTPHEADER => $headers) ); } if (is_array($curl_options)) { $curl_helper->setOptions($curl_options); } $curl_helper->followLocation = false; $ret = $curl_helper->Send($url); $GLOBALS['curl_errorno'] = $curl_helper->lastErrorCode; $GLOBALS['curl_error'] = $curl_helper->lastErrorMsg; return $ret; } /** * Checks if constant is defined and has positive value * * @param string $const_name * @return bool * @access public */ public static function constOn($const_name) { return defined($const_name) && constant($const_name); } /** * Converts KG to Pounds * * @param float $kg * @param bool $pounds_only * @return float * @access public */ public static function Kg2Pounds($kg, $pounds_only = false) { $major = floor( round($kg / self::POUND_TO_KG, 3) ); $minor = abs(round(($kg - $major * self::POUND_TO_KG) / self::POUND_TO_KG * 16, 2)); if ($pounds_only) { $major += round($minor * 0.0625, 2); $minor = 0; } return array($major, $minor); } /** * Converts Pounds to KG * * @param float $pounds * @param float $ounces * @return float * @access public */ public static function Pounds2Kg($pounds, $ounces = 0.00) { return round(($pounds + ($ounces / 16)) * self::POUND_TO_KG, 5); } /** * Formats file/memory size in nice way * * @param int $bytes * @return string * @access public */ public static function formatSize($bytes) { if ($bytes >= 1099511627776) { $return = round($bytes / 1024 / 1024 / 1024 / 1024, 2); $suffix = "TB"; } elseif ($bytes >= 1073741824) { $return = round($bytes / 1024 / 1024 / 1024, 2); $suffix = "GB"; } elseif ($bytes >= 1048576) { $return = round($bytes / 1024 / 1024, 2); $suffix = "MB"; } elseif ($bytes >= 1024) { $return = round($bytes / 1024, 2); $suffix = "KB"; } else { $return = $bytes; $suffix = "Byte"; } $return .= ' '.$suffix; return $return; } /** * Enter description here... * * @param resource $filePointer the file resource to write to * @param Array $data the data to write out * @param string $delimiter the field separator * @param string $enclosure symbol to enclose field data to * @param string $recordSeparator symbols to separate records with * @access public */ public static function fputcsv($filePointer, $data, $delimiter = ',', $enclosure = '"', $recordSeparator = "\r\n") { fwrite($filePointer, self::getcsvline($data, $delimiter, $enclosure, $recordSeparator)); } /** * Enter description here... * * @param Array $data the data to write out * @param string $delimiter the field separator * @param string $enclosure symbol to enclose field data to * @param string $recordSeparator symbols to separate records with * @return string * @access public */ public static function getcsvline($data, $delimiter = ',', $enclosure = '"', $recordSeparator = "\r\n") { ob_start(); $fp = fopen('php://output', 'w'); fputcsv($fp, $data, $delimiter, $enclosure); fclose($fp); $ret = ob_get_clean(); if ( $recordSeparator != "\n" ) { return substr($ret, 0, -1) . $recordSeparator; } return $ret; } /** * Allows to replace #section# within any string with current section * * @param string $string * @return string * @access public */ public static function replaceModuleSection($string) { $application =& kApplication::Instance(); $module_section = $application->RecallVar('section'); if ($module_section) { // substitute section instead of #section# parameter in title preset name $module_section = explode(':', $module_section); $section = preg_replace('/(configuration|configure)_(.*)/i', '\\2', $module_section[count($module_section) == 2 ? 1 : 0]); $string = str_replace('#section#', mb_strtolower($section), $string); } return $string; } /** * Checks, that user IP address is within allowed range * * @param string $ip_list semi-column (by default) separated ip address list * @param string $separator ip address separator (default ";") * * @return bool * @access public */ public static function ipMatch($ip_list, $separator = ';') { if ( php_sapi_name() == 'cli' ) { return false; } $ip_match = false; $ip_addresses = $ip_list ? explode($separator, $ip_list) : Array (); $application =& kApplication::Instance(); $client_ip = $application->getClientIp(); foreach ($ip_addresses as $ip_address) { if ( self::netMatch($ip_address, $client_ip) ) { $ip_match = true; break; } } return $ip_match; } /** * Checks, that given ip belongs to given subnet * * @param string $network * @param string $ip * @return bool * @access public */ public static function netMatch($network, $ip) { $network = trim($network); $ip = trim($ip); if ( preg_replace('/[\d\.\/-]/', '', $network) != '' ) { $network = gethostbyname($network); } if ($network == $ip) { // comparing two ip addresses directly return true; } $d = strpos($network, '-'); if ($d !== false) { // ip address range specified $from = ip2long(trim(substr($network, 0, $d))); $to = ip2long(trim(substr($network, $d + 1))); $ip = ip2long($ip); return ($ip >= $from && $ip <= $to); } elseif (strpos($network, '/') !== false) { // single subnet specified $ip_arr = explode('/', $network); if (!preg_match("@\d*\.\d*\.\d*\.\d*@", $ip_arr[0], $matches)) { $ip_arr[0] .= '.0'; // Alternate form 194.1.4/24 } $network_long = ip2long($ip_arr[0]); $x = ip2long($ip_arr[1]); $mask = long2ip($x) == $ip_arr[1] ? $x : (0xffffffff << (32 - $ip_arr[1])); $ip_long = ip2long($ip); return ($ip_long & $mask) == ($network_long & $mask); } return false; } /** * Returns mime type corresponding to given file * @param string $file * @return string * @access public */ public static function mimeContentType($file) { $ret = self::vendorMimeContentType($file); if ( $ret ) { // vendor-specific mime types override any automatic detection return $ret; } if ( function_exists('finfo_open') && function_exists('finfo_file') ) { $mime_magic_resource = finfo_open(FILEINFO_MIME_TYPE); if ( $mime_magic_resource ) { $ret = finfo_file($mime_magic_resource, $file); finfo_close($mime_magic_resource); } } elseif ( function_exists('mime_content_type') ) { $ret = mime_content_type($file); } return $ret ? $ret : self::mimeContentTypeByExtension($file); } /** * Determines vendor-specific mime type from a given file * * @param string $file * @return bool * @access public * @static */ public static function vendorMimeContentType($file) { $file_extension = mb_strtolower(pathinfo(self::removeTempExtension($file), PATHINFO_EXTENSION)); $mapping = Array ( 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'docm' => 'application/vnd.ms-word.document.macroEnabled.12', 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', 'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12', 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12' ); return isset($mapping[$file_extension]) ? $mapping[$file_extension] : false; } /** * Detects mime type of the file purely based on it's extension * * @param string $file * @return string * @access public */ public static function mimeContentTypeByExtension($file) { $file_extension = mb_strtolower(pathinfo(self::removeTempExtension($file), PATHINFO_EXTENSION)); $mapping = '(xls:application/excel)(hqx:application/macbinhex40)(doc,dot,wrd:application/msword)(pdf:application/pdf) (pgp:application/pgp)(ps,eps,ai:application/postscript)(ppt:application/powerpoint)(rtf:application/rtf) (tgz,gtar:application/x-gtar)(gz:application/x-gzip)(php,php3:application/x-httpd-php)(js:application/x-javascript) (ppd,psd:application/x-photoshop)(swf,swc,rf:application/x-shockwave-flash)(tar:application/x-tar)(zip:application/zip) (mid,midi,kar:audio/midi)(mp2,mp3,mpga:audio/mpeg)(ra:audio/x-realaudio)(wav:audio/wav)(bmp:image/bitmap)(bmp:image/bitmap) (gif:image/gif)(iff:image/iff)(jb2:image/jb2)(jpg,jpe,jpeg:image/jpeg)(jpx:image/jpx)(png:image/png)(tif,tiff:image/tiff) (wbmp:image/vnd.wap.wbmp)(xbm:image/xbm)(css:text/css)(txt:text/plain)(htm,html:text/html)(xml:text/xml) (mpg,mpe,mpeg:video/mpeg)(qt,mov:video/quicktime)(avi:video/x-ms-video)(eml:message/rfc822) (sxw:application/vnd.sun.xml.writer)(sxc:application/vnd.sun.xml.calc)(sxi:application/vnd.sun.xml.impress) (sxd:application/vnd.sun.xml.draw)(sxm:application/vnd.sun.xml.math) (odt:application/vnd.oasis.opendocument.text)(oth:application/vnd.oasis.opendocument.text-web) (odm:application/vnd.oasis.opendocument.text-master)(odg:application/vnd.oasis.opendocument.graphics) (odp:application/vnd.oasis.opendocument.presentation)(ods:application/vnd.oasis.opendocument.spreadsheet) (odc:application/vnd.oasis.opendocument.chart)(odf:application/vnd.oasis.opendocument.formula) (odi:application/vnd.oasis.opendocument.image)'; if ( preg_match('/[\(,]' . $file_extension . '[,]{0,1}.*?:(.*?)\)/s', $mapping, $regs) ) { return $regs[1]; } return 'application/octet-stream'; } /** * Strips ".tmp" suffix (added by flash uploader) from a filename * * @param string $file * @return string * @access public * @static */ public static function removeTempExtension($file) { return preg_replace('/(_[\d]+)?\.tmp$/', '', $file); } /** * Return param value and removes it from params array * * @param string $name * @param Array $params * @param bool $default * @return string */ public static function popParam($name, &$params, $default = false) { if ( isset($params[$name]) ) { $value = $params[$name]; unset($params[$name]); return $value; } return $default; } /** * Generate subpath from hashed value * * @param string $name * @param int $levels * @return string */ public static function getHashPathForLevel($name, $levels = 2) { if ( $levels == 0 ) { return ''; } else { $path = ''; $hash = md5($name); for ($i = 0; $i < $levels; $i++) { $path .= substr($hash, $i, 1) . '/'; } return $path; } } /** * Calculates the crc32 polynomial of a string (always positive number) * * @param string $str * @return int */ public static function crc32($str) { return sprintf('%u', crc32($str)); } /** * Returns instance of DateTime class with date set based on timestamp * * @static * @param int $timestamp * @return DateTime * @access public */ public static function dateFromTimestamp($timestamp) { if ( version_compare(PHP_VERSION, '5.3.0', '<') ) { $date = new DateTime('@' . $timestamp); $date->setTimezone(new DateTimeZone(date_default_timezone_get())); } else { $date = new DateTime(); $date->setTimestamp($timestamp); } return $date; } /** * Returns timestamp from given DateTime class instance * * @static * @param DateTime $date_time * @return int|string * @access public */ public static function timestampFromDate(DateTime $date_time) { if ( version_compare(PHP_VERSION, '5.3.0', '<') ) { return $date_time->format('U'); } return $date_time->getTimestamp(); } /** * Generates random numeric id * * @static * @return string * @access public */ public static function generateId() { list($usec, $sec) = explode(' ', microtime()); $id_part_1 = substr($usec, 4, 4); $id_part_2 = mt_rand(1, 9); $id_part_3 = substr($sec, 6, 4); $digit_one = substr($id_part_1, 0, 1); if ( $digit_one == 0 ) { $digit_one = mt_rand(1, 9); $id_part_1 = preg_replace('/^0/', '', $id_part_1); $id_part_1 = $digit_one . $id_part_1; } return $id_part_1 . $id_part_2 . $id_part_3; } /** * Changes script resource limits. Omitted argument results in limit removal. * * @static * @param string|int $memory_limit * @param int $time_limit * @return void * @access public */ public static function setResourceLimit($memory_limit = null, $time_limit = null) { set_time_limit(isset($time_limit) ? $time_limit : 0); ini_set('memory_limit', isset($memory_limit) ? $memory_limit : -1); } /** * Escapes a string. * * @param string $text Text to escape. * @param string $strategy Escape strategy. * * @return string * @throws InvalidArgumentException When unknown escape strategy is given. */ public static function escape($text, $strategy = null) { if ( !isset($strategy) ) { $strategy = self::$escapeStrategy; } if ( strpos($strategy, '+') !== false ) { $previous_strategy = ''; $strategies = explode('+', $strategy); foreach ($strategies as $current_strategy) { // apply default strategy if ( $current_strategy == '' ) { $current_strategy = self::$escapeStrategy; } // don't double-escape if ( $current_strategy != $previous_strategy ) { $text = self::escape($text, $current_strategy); $previous_strategy = $current_strategy; } } return $text; } if ( $strategy == self::ESCAPE_HTML ) { return htmlspecialchars($text, ENT_QUOTES, CHARSET); } if ( $strategy == self::ESCAPE_JS ) { // TODO: consider using "addcslashes", because "addslashes" isn't really for JavaScript escaping (according to docs) $text = addslashes($text); $text = str_replace(array("\r", "\n"), array('\r', '\n'), $text); $text = str_replace('', "", $text); return $text; } if ( $strategy == self::ESCAPE_URL ) { return rawurlencode($text); } if ( $strategy == self::ESCAPE_RAW ) { return $text; } throw new InvalidArgumentException(sprintf('Unknown escape strategy "%s"', $strategy)); } /** * Unescapes a string. * * @param string $text Text to unescape. * @param string $strategy Escape strategy. * * @return string * @throws InvalidArgumentException When unknown escape strategy is given. */ public static function unescape($text, $strategy = null) { if ( !isset($strategy) ) { $strategy = self::$escapeStrategy; } if ( strpos($strategy, '+') !== false ) { $previous_strategy = ''; $strategies = explode('+', $strategy); foreach ($strategies as $current_strategy) { // apply default strategy if ( $current_strategy == '' ) { $current_strategy = self::$escapeStrategy; } // don't double-unescape if ( $current_strategy != $previous_strategy ) { $text = self::unescape($text, $current_strategy); $previous_strategy = $current_strategy; } } return $text; } if ( $strategy == self::ESCAPE_HTML ) { return htmlspecialchars_decode($text, ENT_QUOTES); } if ( $strategy == self::ESCAPE_JS ) { // TODO: consider using "stripcslashes", because "stripslashes" isn't really for JavaScript unescaping (according to docs) $text = str_replace("", '', $text); $text = str_replace(array('\r', '\n'), array("\r", "\n"), $text); $text = stripslashes($text); return $text; } if ( $strategy == self::ESCAPE_URL ) { return rawurldecode($text); } if ( $strategy == self::ESCAPE_RAW ) { return $text; } throw new InvalidArgumentException(sprintf('Unknown escape strategy "%s"', $strategy)); } + + /** + * Mark a method as deprecated and inform when it has been used. + * + * The current behavior is to trigger a user deprecation notice in Debug Mode. + * This method is to be used in every method that is deprecated. + * + * @param string $method The method that was called. + * @param string $version The version that deprecated the method. + * @param string|null $replacement The method that should have been called. + * + * @return void + */ + public static function deprecatedMethod($method, $version, $replacement = null) + { + $application =& kApplication::Instance(); + + if ( !$application->isDebugMode() ) { + return; + } + + $msg = '%1$s is deprecated since version %2$s'; + + if ( !is_null($replacement) ) { + @trigger_error(sprintf($msg . '! Use %3$s instead.', $method, $version, $replacement), E_USER_DEPRECATED); + } + else { + @trigger_error(sprintf($msg . ' with no alternative available.', $method, $version), E_USER_DEPRECATED); + } + } + + /** + * Mark a method argument as deprecated and inform when it has been used. + * + * This method is to be used whenever a deprecated method argument is used. + * Before this method is called, the argument must be checked for whether it was + * used by comparing it to its default value or evaluating whether it is empty. + * For example: + * + * if ( !$deprecated ) { + * kUtil::deprecatedArgument(__METHOD__, '5.2.2'); + * } + * + * The current behavior is to trigger a user deprecation notice in Debug Mode. + * + * @param string $method The method that was called. + * @param string $version The version that deprecated the argument used. + * @param string|null $message A message regarding the change. + * + * @return void + */ + public static function deprecatedArgument($method, $version, $message = null) + { + $application =& kApplication::Instance(); + + if ( !$application->isDebugMode() ) { + return; + } + + $msg = '%1$s was called with an argument that is deprecated since version %2$s'; + + if ( !is_null($message) ) { + @trigger_error(sprintf($msg . '! %3$s', $method, $version, $message), E_USER_DEPRECATED); + } + else { + @trigger_error(sprintf($msg . ' with no alternative available.', $method, $version), E_USER_DEPRECATED); + } + } + } /** * Returns array value if key exists * Accepts infinite number of parameters * * @param Array $array searchable array * @param int $key array key * @return string */ function getArrayValue(&$array, $key) { $ret = isset($array[$key]) ? $array[$key] : false; if ( $ret && func_num_args() > 2 ) { for ($i = 2; $i < func_num_args(); $i++) { $cur_key = func_get_arg($i); $ret = getArrayValue($ret, $cur_key); if ( $ret === false ) { break; } } } return $ret; } if ( !function_exists('parse_ini_string') ) { /** * Equivalent for "parse_ini_string" function available since PHP 5.3.0 * * @param string $ini * @param bool $process_sections * @param int $scanner_mode * @return Array */ function parse_ini_string($ini, $process_sections = false, $scanner_mode = NULL) { # Generate a temporary file. $tempname = tempnam('/tmp', 'ini'); $fp = fopen($tempname, 'w'); fwrite($fp, $ini); $ini = parse_ini_file($tempname, !empty($process_sections)); fclose($fp); @unlink($tempname); return $ini; } } if ( !function_exists('memory_get_usage') ) { // PHP 4.x and compiled without --enable-memory-limit option function memory_get_usage() { return -1; } } if ( !function_exists('imagecreatefrombmp') ) { // just in case if GD will add this function in future function imagecreatefrombmp($filename) { //Ouverture du fichier en mode binaire if (! $f1 = fopen($filename,"rb")) return FALSE; //1 : Chargement des ent�tes FICHIER $FILE = unpack("vfile_type/Vfile_size/Vreserved/Vbitmap_offset", fread($f1,14)); if ($FILE['file_type'] != 19778) return FALSE; //2 : Chargement des ent�tes BMP $BMP = unpack('Vheader_size/Vwidth/Vheight/vplanes/vbits_per_pixel'. '/Vcompression/Vsize_bitmap/Vhoriz_resolution'. '/Vvert_resolution/Vcolors_used/Vcolors_important', fread($f1,40)); $BMP['colors'] = pow(2,$BMP['bits_per_pixel']); if ($BMP['size_bitmap'] == 0) $BMP['size_bitmap'] = $FILE['file_size'] - $FILE['bitmap_offset']; $BMP['bytes_per_pixel'] = $BMP['bits_per_pixel']/8; $BMP['bytes_per_pixel2'] = ceil($BMP['bytes_per_pixel']); $BMP['decal'] = ($BMP['width']*$BMP['bytes_per_pixel']/4); $BMP['decal'] -= floor($BMP['width']*$BMP['bytes_per_pixel']/4); $BMP['decal'] = 4-(4*$BMP['decal']); if ($BMP['decal'] == 4) $BMP['decal'] = 0; //3 : Chargement des couleurs de la palette $PALETTE = array(); if ($BMP['colors'] < 16777216) { $PALETTE = unpack('V'.$BMP['colors'], fread($f1,$BMP['colors']*4)); } //4 : Cr�ation de l'image $IMG = fread($f1,$BMP['size_bitmap']); $VIDE = chr(0); $res = imagecreatetruecolor($BMP['width'],$BMP['height']); $P = 0; $Y = $BMP['height']-1; while ($Y >= 0) { $X=0; while ($X < $BMP['width']) { if ($BMP['bits_per_pixel'] == 24) $COLOR = unpack("V",substr($IMG,$P,3).$VIDE); elseif ($BMP['bits_per_pixel'] == 16) { $COLOR = unpack("n",substr($IMG,$P,2)); $COLOR[1] = $PALETTE[$COLOR[1]+1]; } elseif ($BMP['bits_per_pixel'] == 8) { $COLOR = unpack("n",$VIDE.substr($IMG,$P,1)); $COLOR[1] = $PALETTE[$COLOR[1]+1]; } elseif ($BMP['bits_per_pixel'] == 4) { $COLOR = unpack("n",$VIDE.substr($IMG,floor($P),1)); if (($P*2)%2 == 0) $COLOR[1] = ($COLOR[1] >> 4) ; else $COLOR[1] = ($COLOR[1] & 0x0F); $COLOR[1] = $PALETTE[$COLOR[1]+1]; } elseif ($BMP['bits_per_pixel'] == 1) { $COLOR = unpack("n",$VIDE.substr($IMG,floor($P),1)); if (($P*8)%8 == 0) $COLOR[1] = $COLOR[1] >>7; elseif (($P*8)%8 == 1) $COLOR[1] = ($COLOR[1] & 0x40)>>6; elseif (($P*8)%8 == 2) $COLOR[1] = ($COLOR[1] & 0x20)>>5; elseif (($P*8)%8 == 3) $COLOR[1] = ($COLOR[1] & 0x10)>>4; elseif (($P*8)%8 == 4) $COLOR[1] = ($COLOR[1] & 0x8)>>3; elseif (($P*8)%8 == 5) $COLOR[1] = ($COLOR[1] & 0x4)>>2; elseif (($P*8)%8 == 6) $COLOR[1] = ($COLOR[1] & 0x2)>>1; elseif (($P*8)%8 == 7) $COLOR[1] = ($COLOR[1] & 0x1); $COLOR[1] = $PALETTE[$COLOR[1]+1]; } else return FALSE; imagesetpixel($res,$X,$Y,$COLOR[1]); $X++; $P += $BMP['bytes_per_pixel']; } $Y--; $P+=$BMP['decal']; } //Fermeture du fichier fclose($f1); return $res; } } Index: branches/5.3.x/core/install/upgrades.sql =================================================================== --- branches/5.3.x/core/install/upgrades.sql (revision 16544) +++ branches/5.3.x/core/install/upgrades.sql (revision 16545) @@ -1,3054 +1,3060 @@ # ===== v 4.0.1 ===== ALTER TABLE EmailLog ADD EventParams TEXT NOT NULL; INSERT INTO ConfigurationAdmin VALUES ('MailFunctionHeaderSeparator', 'la_Text_smtp_server', 'la_config_MailFunctionHeaderSeparator', 'radio', NULL, '1=la_Linux,2=la_Windows', 30.08, 0, 0); INSERT INTO ConfigurationValues VALUES (0, 'MailFunctionHeaderSeparator', 1, 'In-Portal', 'in-portal:configure_general'); ALTER TABLE PersistantSessionData DROP PRIMARY KEY ; ALTER TABLE PersistantSessionData ADD INDEX ( `PortalUserId` ) ; # ===== v 4.1.0 ===== ALTER TABLE EmailMessage ADD ReplacementTags TEXT AFTER Template; ALTER TABLE Phrase CHANGE Translation Translation TEXT NOT NULL, CHANGE Module Module VARCHAR(30) NOT NULL DEFAULT 'In-Portal'; ALTER TABLE Category CHANGE Description Description TEXT, CHANGE l1_Description l1_Description TEXT, CHANGE l2_Description l2_Description TEXT, CHANGE l3_Description l3_Description TEXT, CHANGE l4_Description l4_Description TEXT, CHANGE l5_Description l5_Description TEXT, CHANGE CachedNavbar CachedNavbar text, CHANGE l1_CachedNavbar l1_CachedNavbar text, CHANGE l2_CachedNavbar l2_CachedNavbar text, CHANGE l3_CachedNavbar l3_CachedNavbar text, CHANGE l4_CachedNavbar l4_CachedNavbar text, CHANGE l5_CachedNavbar l5_CachedNavbar text, CHANGE ParentPath ParentPath TEXT NULL DEFAULT NULL, CHANGE NamedParentPath NamedParentPath TEXT NULL DEFAULT NULL; ALTER TABLE ConfigurationAdmin CHANGE ValueList ValueList TEXT; ALTER TABLE EmailQueue CHANGE `Subject` `Subject` TEXT, CHANGE toaddr toaddr TEXT, CHANGE fromaddr fromaddr TEXT; ALTER TABLE Category DROP Pop; ALTER TABLE PortalUser CHANGE CreatedOn CreatedOn INT DEFAULT NULL, CHANGE dob dob INT(11) NULL DEFAULT NULL, CHANGE PassResetTime PassResetTime INT(11) UNSIGNED NULL DEFAULT NULL, CHANGE PwRequestTime PwRequestTime INT(11) UNSIGNED NULL DEFAULT NULL, CHANGE `Password` `Password` VARCHAR(255) NULL DEFAULT 'd41d8cd98f00b204e9800998ecf8427e'; ALTER TABLE Modules CHANGE BuildDate BuildDate INT UNSIGNED NULL DEFAULT NULL, CHANGE Version Version VARCHAR(10) NOT NULL DEFAULT '0.0.0', CHANGE `Var` `Var` VARCHAR(100) NOT NULL DEFAULT ''; ALTER TABLE Language CHANGE Enabled Enabled INT(11) NOT NULL DEFAULT '1', CHANGE InputDateFormat InputDateFormat VARCHAR(50) NOT NULL DEFAULT 'm/d/Y', CHANGE InputTimeFormat InputTimeFormat VARCHAR(50) NOT NULL DEFAULT 'g:i:s A', CHANGE DecimalPoint DecimalPoint VARCHAR(10) NOT NULL DEFAULT '', CHANGE ThousandSep ThousandSep VARCHAR(10) NOT NULL DEFAULT ''; ALTER TABLE Events CHANGE FromUserId FromUserId INT(11) NOT NULL DEFAULT '-1'; ALTER TABLE StdDestinations CHANGE DestAbbr2 DestAbbr2 CHAR(2) NULL DEFAULT NULL; ALTER TABLE PermCache DROP DACL; ALTER TABLE PortalGroup CHANGE CreatedOn CreatedOn INT UNSIGNED NULL DEFAULT NULL; ALTER TABLE UserSession CHANGE SessionKey SessionKey INT UNSIGNED NULL DEFAULT NULL , CHANGE CurrentTempKey CurrentTempKey INT UNSIGNED NULL DEFAULT NULL , CHANGE PrevTempKey PrevTempKey INT UNSIGNED NULL DEFAULT NULL , CHANGE LastAccessed LastAccessed INT UNSIGNED NOT NULL DEFAULT '0', CHANGE PortalUserId PortalUserId INT(11) NOT NULL DEFAULT '-2', CHANGE Language Language INT(11) NOT NULL DEFAULT '1', CHANGE Theme Theme INT(11) NOT NULL DEFAULT '1'; CREATE TABLE Counters ( CounterId int(10) unsigned NOT NULL auto_increment, Name varchar(100) NOT NULL default '', CountQuery text, CountValue text, LastCounted int(10) unsigned default NULL, LifeTime int(10) unsigned NOT NULL default '3600', IsClone tinyint(3) unsigned NOT NULL default '0', TablesAffected text, PRIMARY KEY (CounterId), UNIQUE KEY Name (Name) ); CREATE TABLE Skins ( `SkinId` int(11) NOT NULL auto_increment, `Name` varchar(255) default NULL, `CSS` text, `Logo` varchar(255) default NULL, `Options` text, `LastCompiled` int(11) NOT NULL default '0', `IsPrimary` int(1) NOT NULL default '0', PRIMARY KEY (`SkinId`) ); INSERT INTO Skins VALUES (DEFAULT, 'Default', '/* General elements */\r\n\r\nhtml {\r\n height: 100%;\r\n}\r\n\r\nbody {\r\n font-family: verdana,arial,helvetica,sans-serif;\r\n font-size: 9pt;\r\n color: #000000;\r\n overflow-x: auto; overflow-y: auto;\r\n margin: 0px 0px 0px 0px;\r\n text-decoration: none;\r\n}\r\n\r\na {\r\n color: #006699;\r\n text-decoration: none;\r\n}\r\n\r\na:hover {\r\n color: #009ff0;\r\n text-decoration: none;\r\n}\r\n\r\nform {\r\n display: inline;\r\n}\r\n\r\nimg { border: 0px; }\r\n\r\nbody.height-100 {\r\n height: 100%;\r\n}\r\n\r\nbody.regular-body {\r\n margin: 0px 10px 5px 10px;\r\n color: #000000;\r\n background-color: @@SectionBgColor@@;\r\n}\r\n\r\nbody.edit-popup {\r\n margin: 0px 0px 0px 0px;\r\n}\r\n\r\ntable.collapsed {\r\n border-collapse: collapse;\r\n}\r\n\r\n.bordered, table.bordered, .bordered-no-bottom {\r\n border: 1px solid #000000;\r\n border-collapse: collapse;\r\n}\r\n\r\n.bordered-no-bottom {\r\n border-bottom: none;\r\n}\r\n\r\n.login-table td {\r\n padding: 1px;\r\n}\r\n\r\n.disabled {\r\n background-color: #ebebeb;\r\n}\r\n\r\n/* Head frame */\r\n.head-table tr td {\r\n background-color: @@HeadBgColor@@;\r\n color: @@HeadColor@@\r\n}\r\n\r\ntd.kx-block-header, .head-table tr td.kx-block-header{\r\n color: @@HeadBarColor@@;\r\n background-color: @@HeadBarBgColor@@;\r\n padding-left: 7px;\r\n padding-right: 7px;\r\n}\r\n\r\na.kx-header-link {\r\n text-decoration: underline;\r\n color: #FFFFFF;\r\n}\r\n\r\na.kx-header-link:hover {\r\n color: #FFCB05;\r\n text-decoration: none;\r\n}\r\n\r\n.kx-secondary-foreground {\r\n color: @@HeadBarColor@@;\r\n background-color: @@HeadBarBgColor@@;\r\n}\r\n\r\n.kx-login-button {\r\n background-color: #2D79D6;\r\n color: #FFFFFF;\r\n}\r\n\r\n/* General form button (yellow) */\r\n.button {\r\n font-size: 12px;\r\n font-weight: normal;\r\n color: #000000;\r\n background: url(@@base_url@@/proj-base/admin_templates/img/button_back.gif) #f9eeae repeat-x;\r\n text-decoration: none;\r\n}\r\n\r\n/* Disabled (grayed-out) form button */\r\n.button-disabled {\r\n font-size: 12px;\r\n font-weight: normal;\r\n color: #676767;\r\n background: url(@@base_url@@/proj-base/admin_templates/img/button_back_disabled.gif) #f9eeae repeat-x;\r\n text-decoration: none;\r\n}\r\n\r\n/* Tabs bar */\r\n\r\n.tab, .tab-active {\r\n background-color: #F0F1EB;\r\n padding: 3px 7px 2px 7px;\r\n border-top: 1px solid black;\r\n border-left: 1px solid black;\r\n border-right: 1px solid black;\r\n}\r\n\r\n.tab-active {\r\n background-color: #2D79D6;\r\n border-bottom: 1px solid #2D79D6;\r\n}\r\n\r\n.tab a {\r\n color: #00659C;\r\n font-weight: bold;\r\n}\r\n\r\n.tab-active a {\r\n color: #fff;\r\n font-weight: bold;\r\n}\r\n\r\n\r\n/* Toolbar */\r\n\r\n.toolbar {\r\n font-size: 8pt;\r\n border: 1px solid #000000;\r\n border-width: 0px 1px 1px 1px;\r\n background-color: @@ToolbarBgColor@@;\r\n border-collapse: collapse;\r\n}\r\n\r\n.toolbar td {\r\n height: 100%;\r\n}\r\n\r\n.toolbar-button, .toolbar-button-disabled, .toolbar-button-over {\r\n float: left;\r\n text-align: center;\r\n font-size: 8pt;\r\n padding: 5px 5px 5px 5px;\r\n vertical-align: middle;\r\n color: #006F99;\r\n}\r\n\r\n.toolbar-button-over {\r\n color: #000;\r\n}\r\n\r\n.toolbar-button-disabled {\r\n color: #444;\r\n}\r\n\r\n/* Scrollable Grids */\r\n\r\n\r\n/* Main Grid class */\r\n.grid-scrollable {\r\n padding: 0px;\r\n border: 1px solid black !important;\r\n border-top: none !important;\r\n}\r\n\r\n/* Div generated by js, which contains all the scrollable grid elements, affects the style of scrollable area without data (if there are too few rows) */\r\n.grid-container {\r\n background-color: #fff;\r\n}\r\n\r\n.grid-container table {\r\n border-collapse: collapse;\r\n}\r\n\r\n/* Inner div generated in each data-cell */\r\n.grid-cell-div {\r\n overflow: hidden;\r\n height: auto;\r\n}\r\n\r\n/* Main row definition */\r\n.grid-data-row td, .grid-data-row-selected td, .grid-data-row-even-selected td, .grid-data-row-mouseover td, .table-color1, .table-color2 {\r\n font-weight: normal;\r\n color: @@OddColor@@;\r\n background-color: @@OddBgColor@@;\r\n padding: 3px 5px 3px 5px;\r\n height: 30px;\r\n overflow: hidden;\r\n /* border-right: 1px solid black; */\r\n}\r\n.grid-data-row-even td, .table-color2 {\r\n background-color: @@EvenBgColor@@;\r\n color: @@EvenColor@@;\r\n}\r\n.grid-data-row td a, .grid-data-row-selected td a, .grid-data-row-mouseover td a {\r\n text-decoration: underline;\r\n}\r\n\r\n/* mouse-over rows */\r\n.grid-data-row-mouseover td {\r\n background: #FFFDF4;\r\n}\r\n\r\n/* Selected row, applies to both checkbox and data areas */\r\n.grid-data-row-selected td {\r\n background: #FEF2D6;\r\n}\r\n\r\n.grid-data-row-even-selected td {\r\n background: #FFF7E0;\r\n}\r\n\r\n/* General header cell definition */\r\n.grid-header-row td {\r\n font-weight: bold;\r\n background-color: @@ColumnTitlesBgColor@@;\r\n text-decoration: none;\r\n padding: 3px 5px 3px 5px;\r\n color: @@ColumnTitlesColor@@;\r\n border-right: none;\r\n text-align: left;\r\n vertical-align: middle !important;\r\n white-space: nowrap;\r\n /* border-right: 1px solid black; */\r\n}\r\n\r\n/* Filters row */\r\ntr.grid-header-row-0 td {\r\n background-color: @@FiltersBgColor@@;\r\n border-bottom: 1px solid black;\r\n}\r\n\r\n/* Grid Filters */\r\ntable.range-filter {\r\n width: 100%;\r\n}\r\n\r\n.range-filter td {\r\n padding: 0px 0px 2px 2px !important;\r\n border: none !important;\r\n font-size: 8pt !important;\r\n font-weight: normal !important;\r\n text-align: left;\r\n color: #000000 !important;\r\n}\r\n\r\ninput.filter, select.filter {\r\n margin-bottom: 0px;\r\n width: 85%;\r\n}\r\n\r\ninput.filter-active {\r\n background-color: #FFFF00;\r\n}\r\n\r\nselect.filter-active {\r\n background-color: #FFFF00;\r\n}\r\n\r\n/* Column titles row */\r\ntr.grid-header-row-1 td {\r\n height: 25px;\r\n font-weight: bold;\r\n background-color: @@ColumnTitlesBgColor@@;\r\n color: @@ColumnTitlesColor@@;\r\n}\r\n\r\ntr.grid-header-row-1 td a {\r\n color: @@ColumnTitlesColor@@;\r\n}\r\n\r\ntr.grid-header-row-1 td a:hover {\r\n color: #FFCC00;\r\n}\r\n\r\n\r\n.grid-footer-row td {\r\n background-color: #D7D7D7;\r\n font-weight: bold;\r\n border-right: none;\r\n padding: 3px 5px 3px 5px;\r\n}\r\n\r\ntd.grid-header-last-cell, td.grid-data-last-cell, td.grid-footer-last-cell {\r\n border-right: none !important;\r\n}\r\n\r\ntd.grid-data-col-0, td.grid-data-col-0 div {\r\n text-align: center;\r\n vertical-align: middle !important;\r\n}\r\n\r\ntr.grid-header-row-0 td.grid-header-col-0 {\r\n text-align: center;\r\n vertical-align: middle !important;\r\n}\r\n\r\ntr.grid-header-row-0 td.grid-header-col-0 div {\r\n display: table-cell;\r\n vertical-align: middle;\r\n}\r\n\r\n.grid-status-bar {\r\n border: 1px solid black;\r\n border-top: none;\r\n padding: 0px;\r\n width: 100%;\r\n border-collapse: collapse;\r\n height: 30px;\r\n}\r\n\r\n.grid-status-bar td {\r\n background-color: @@TitleBarBgColor@@;\r\n color: @@TitleBarColor@@;\r\n font-size: 11pt;\r\n font-weight: normal;\r\n padding: 2px 8px 2px 8px;\r\n}\r\n\r\n/* /Scrollable Grids */\r\n\r\n\r\n/* Forms */\r\ntable.edit-form {\r\n border: none;\r\n border-top-width: 0px;\r\n border-collapse: collapse;\r\n width: 100%;\r\n}\r\n\r\n.edit-form-odd, .edit-form-even {\r\n padding: 0px;\r\n}\r\n\r\n.subsectiontitle {\r\n font-size: 10pt;\r\n font-weight: bold;\r\n background-color: #4A92CE;\r\n color: #fff;\r\n height: 25px;\r\n border-top: 1px solid black;\r\n}\r\n\r\n.label-cell {\r\n background: #DEE7F6 url(@@base_url@@/proj-base/admin_templates/img/bgr_input_name_line.gif) no-repeat right bottom;\r\n font: 12px arial, sans-serif;\r\n padding: 4px 20px;\r\n width: 150px;\r\n}\r\n\r\n.control-mid {\r\n width: 13px;\r\n border-left: 1px solid #7A95C2;\r\n background: #fff url(@@base_url@@/proj-base/admin_templates/img/bgr_mid.gif) repeat-x left bottom;\r\n}\r\n\r\n.control-cell {\r\n font: 11px arial, sans-serif;\r\n padding: 4px 10px 5px 5px;\r\n background: #fff url(@@base_url@@/proj-base/admin_templates/img/bgr_input_line.gif) no-repeat left bottom;\r\n width: auto;\r\n vertical-align: middle;\r\n}\r\n\r\n.label-cell-filler {\r\n background: #DEE7F6 none;\r\n}\r\n.control-mid-filler {\r\n background: #fff none;\r\n border-left: 1px solid #7A95C2;\r\n}\r\n.control-cell-filler {\r\n background: #fff none;\r\n}\r\n\r\n\r\n.error-cell {\r\n background-color: #fff;\r\n color: red;\r\n}\r\n\r\n.form-warning {\r\n color: red;\r\n}\r\n\r\n.req-note {\r\n font-style: italic;\r\n color: #333;\r\n}\r\n\r\n#scroll_container table.tableborder {\r\n border-collapse: separate\r\n}\r\n\r\n\r\n/* Uploader */\r\n\r\n.uploader-main {\r\n position: absolute;\r\n display: none;\r\n z-index: 10;\r\n border: 1px solid #777;\r\n padding: 10px;\r\n width: 350px;\r\n height: 120px;\r\n overflow: hidden;\r\n background-color: #fff;\r\n}\r\n\r\n.uploader-percent {\r\n width: 100%;\r\n padding-top: 3px;\r\n text-align: center;\r\n position: relative;\r\n z-index: 20;\r\n float: left;\r\n font-weight: bold;\r\n}\r\n\r\n.uploader-left {\r\n width: 100%;\r\n border: 1px solid black;\r\n height: 20px;\r\n background: #fff url(@@base_url@@/core/admin_templates/img/progress_left.gif);\r\n}\r\n\r\n.uploader-done {\r\n width: 0%;\r\n background-color: green;\r\n height: 20px;\r\n background: #4A92CE url(@@base_url@@/core/admin_templates/img/progress_done.gif);\r\n}\r\n\r\n\r\n/* To be sorted */\r\n\r\n\r\n/* Section title, right to the big icon */\r\n.admintitle {\r\n font-size: 16pt;\r\n font-weight: bold;\r\n color: @@SectionColor@@;\r\n text-decoration: none;\r\n}\r\n\r\n/* Left sid of bluebar */\r\n.header_left_bg {\r\n background-color: @@TitleBarBgColor@@;\r\n background-image: none;\r\n padding-left: 5px;\r\n}\r\n\r\n/* Right side of bluebar */\r\n.tablenav, tablenav a {\r\n font-size: 11pt;\r\n font-weight: bold;\r\n color: @@TitleBarColor@@;\r\n\r\n text-decoration: none;\r\n background-color: @@TitleBarBgColor@@;\r\n background-image: none;\r\n}\r\n\r\n/* Section title in the bluebar * -- why ''link''? :S */\r\n.tablenav_link {\r\n font-size: 11pt;\r\n font-weight: bold;\r\n color: @@TitleBarColor@@;\r\n text-decoration: none;\r\n}\r\n\r\n/* Active page in top and bottom bluebars pagination */\r\n.current_page {\r\n font-size: 10pt;\r\n font-weight: bold;\r\n background-color: #fff;\r\n color: #2D79D6;\r\n padding: 3px 2px 3px 3px;\r\n}\r\n\r\n/* Other pages and arrows in pagination on blue */\r\n.nav_url {\r\n font-size: 10pt;\r\n font-weight: bold;\r\n color: #fff;\r\n padding: 3px 2px 3px 3px;\r\n}\r\n\r\n/* Tree */\r\n.tree-body {\r\n background-color: @@TreeBgColor@@;\r\n height: 100%\r\n}\r\n\r\n.tree_head.td, .tree_head, .tree_head:hover {\r\n font-weight: bold;\r\n font-size: 10px;\r\n color: #FFFFFF;\r\n font-family: Verdana, Arial;\r\n text-decoration: none;\r\n}\r\n\r\n.tree {\r\n padding: 0px;\r\n border: none;\r\n border-collapse: collapse;\r\n}\r\n\r\n.tree tr td {\r\n padding: 0px;\r\n margin: 0px;\r\n font-family: helvetica, arial, verdana,;\r\n font-size: 11px;\r\n white-space: nowrap;\r\n}\r\n\r\n.tree tr td a {\r\n font-size: 11px;\r\n color: @@TreeColor@@;\r\n font-family: Helvetica, Arial, Verdana;\r\n text-decoration: none;\r\n padding: 2px 0px 2px 2px;\r\n}\r\n\r\n.tree tr.highlighted td a {\r\n background-color: @@TreeHighBgColor@@;\r\n color: @@TreeHighColor@@;\r\n}\r\n\r\n.tree tr.highlighted td a:hover {\r\n color: #fff;\r\n}\r\n\r\n.tree tr td a:hover {\r\n color: #000000;\r\n}', 'just_logo.gif', 'a:20:{s:11:"HeadBgColor";a:2:{s:11:"Description";s:27:"Head frame background color";s:5:"Value";s:7:"#1961B8";}s:9:"HeadColor";a:2:{s:11:"Description";s:21:"Head frame text color";s:5:"Value";s:7:"#CCFF00";}s:14:"SectionBgColor";a:2:{s:11:"Description";s:28:"Section bar background color";s:5:"Value";s:7:"#FFFFFF";}s:12:"SectionColor";a:2:{s:11:"Description";s:22:"Section bar text color";s:5:"Value";s:7:"#2D79D6";}s:12:"HeadBarColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:14:"HeadBarBgColor";a:1:{s:5:"Value";s:7:"#1961B8";}s:13:"TitleBarColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:15:"TitleBarBgColor";a:1:{s:5:"Value";s:7:"#2D79D6";}s:14:"ToolbarBgColor";a:1:{s:5:"Value";s:7:"#F0F1EB";}s:14:"FiltersBgColor";a:1:{s:5:"Value";s:7:"#D7D7D7";}s:17:"ColumnTitlesColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:19:"ColumnTitlesBgColor";a:1:{s:5:"Value";s:7:"#999999";}s:8:"OddColor";a:1:{s:5:"Value";s:7:"#000000";}s:10:"OddBgColor";a:1:{s:5:"Value";s:7:"#F6F6F6";}s:9:"EvenColor";a:1:{s:5:"Value";s:7:"#000000";}s:11:"EvenBgColor";a:1:{s:5:"Value";s:7:"#EBEBEB";}s:9:"TreeColor";a:1:{s:5:"Value";s:7:"#006F99";}s:11:"TreeBgColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:13:"TreeHighColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:15:"TreeHighBgColor";a:1:{s:5:"Value";s:7:"#4A92CE";}}', 1178706881, 1); INSERT INTO Permissions VALUES (0, 'in-portal:skins.view', 11, 1, 1, 0), (0, 'in-portal:skins.add', 11, 1, 1, 0), (0, 'in-portal:skins.edit', 11, 1, 1, 0), (0, 'in-portal:skins.delete', 11, 1, 1, 0); # ===== v 4.1.1 ===== DROP TABLE EmailQueue; CREATE TABLE EmailQueue ( EmailQueueId int(10) unsigned NOT NULL auto_increment, ToEmail varchar(255) NOT NULL default '', `Subject` varchar(255) NOT NULL default '', MessageHeaders text, MessageBody longtext, Queued int(10) unsigned NOT NULL default '0', SendRetries int(10) unsigned NOT NULL default '0', LastSendRetry int(10) unsigned NOT NULL default '0', PRIMARY KEY (EmailQueueId), KEY LastSendRetry (LastSendRetry), KEY SendRetries (SendRetries) ); ALTER TABLE Events ADD ReplacementTags TEXT AFTER Event; # ===== v 4.2.0 ===== ALTER TABLE CustomField ADD MultiLingual TINYINT UNSIGNED NOT NULL DEFAULT '1' AFTER FieldLabel; ALTER TABLE Category ADD TreeLeft BIGINT NOT NULL AFTER ParentPath, ADD TreeRight BIGINT NOT NULL AFTER TreeLeft; ALTER TABLE Category ADD INDEX (TreeLeft); ALTER TABLE Category ADD INDEX (TreeRight); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CategoriesRebuildSerial', '0', 'In-Portal', ''); UPDATE ConfigurationAdmin SET `element_type` = 'textarea' WHERE `VariableName` IN ('Category_MetaKey', 'Category_MetaDesc'); ALTER TABLE PortalUser CHANGE FirstName FirstName VARCHAR(255) NOT NULL DEFAULT '', CHANGE LastName LastName VARCHAR(255) NOT NULL DEFAULT ''; # ===== v 4.2.1 ===== INSERT INTO ConfigurationAdmin VALUES ('UseSmallHeader', 'la_Text_Website', 'la_config_UseSmallHeader', 'checkbox', '', '', 10.21, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseSmallHeader', '0', 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationAdmin VALUES ('User_Default_Registration_Country', 'la_Text_General', 'la_config_DefaultRegistrationCountry', 'select', NULL , '=+,SELECT DestName AS OptionName, DestId AS OptionValue FROM StdDestinations WHERE DestParentId IS NULL Order BY OptionName', 10.111, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'User_Default_Registration_Country', '', 'In-Portal:Users', 'in-portal:configure_users'); ALTER TABLE Category ADD SymLinkCategoryId INT UNSIGNED NULL DEFAULT NULL AFTER `Type`, ADD INDEX (SymLinkCategoryId); ALTER TABLE ConfigurationValues CHANGE VariableValue VariableValue TEXT NULL DEFAULT NULL; ALTER TABLE Language ADD AdminInterfaceLang TINYINT UNSIGNED NOT NULL AFTER PrimaryLang, ADD Priority INT NOT NULL AFTER AdminInterfaceLang; UPDATE Language SET AdminInterfaceLang = 1 WHERE PrimaryLang = 1; DELETE FROM PersistantSessionData WHERE VariableName = 'lang_columns_.'; ALTER TABLE SessionData CHANGE VariableValue VariableValue longtext NOT NULL; INSERT INTO ConfigurationAdmin VALUES ('CSVExportDelimiter', 'la_Text_CSV_Export', 'la_config_CSVExportDelimiter', 'select', NULL, '0=la_Tab,1=la_Comma,2=la_Semicolon,3=la_Space,4=la_Colon', 40.1, 0, 1); INSERT INTO ConfigurationAdmin VALUES ('CSVExportEnclosure', 'la_Text_CSV_Export', 'la_config_CSVExportEnclosure', 'radio', NULL, '0=la_Doublequotes,1=la_Quotes', 40.2, 0, 1); INSERT INTO ConfigurationAdmin VALUES ('CSVExportSeparator', 'la_Text_CSV_Export', 'la_config_CSVExportSeparator', 'radio', NULL, '0=la_Linux,1=la_Windows', 40.3, 0, 1); INSERT INTO ConfigurationAdmin VALUES ('CSVExportEncoding', 'la_Text_CSV_Export', 'la_config_CSVExportEncoding', 'radio', NULL, '0=la_Unicode,1=la_Regular', 40.4, 0, 1); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportDelimiter', '0', 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportEnclosure', '0', 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportSeparator', '0', 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportEncoding', '0', 'In-Portal', 'in-portal:configure_general'); # ===== v 4.2.2 ===== INSERT INTO ConfigurationAdmin VALUES ('UseColumnFreezer', 'la_Text_Website', 'la_config_UseColumnFreezer', 'checkbox', '', '', 10.22, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseColumnFreezer', '0', 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationAdmin VALUES ('TrimRequiredFields', 'la_Text_Website', 'la_config_TrimRequiredFields', 'checkbox', '', '', 10.23, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'TrimRequiredFields', '0', 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationAdmin VALUES ('MenuFrameWidth', 'la_title_General', 'la_prompt_MenuFrameWidth', 'text', NULL, NULL, '11', '0', '0'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'MenuFrameWidth', 200, 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationAdmin VALUES ('DefaultSettingsUserId', 'la_title_General', 'la_prompt_DefaultUserId', 'text', NULL, NULL, '12', '0', '0'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'DefaultSettingsUserId', -1, 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationAdmin VALUES ('KeepSessionOnBrowserClose', 'la_title_General', 'la_prompt_KeepSessionOnBrowserClose', 'checkbox', NULL, NULL, '13', '0', '0'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'KeepSessionOnBrowserClose', 0, 'In-Portal', 'in-portal:configure_general'); ALTER TABLE PersistantSessionData ADD VariableId BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST; # ===== v 4.3.0 ===== INSERT INTO ConfigurationAdmin VALUES ('u_MaxImageCount', 'la_section_ImageSettings', 'la_config_MaxImageCount', 'text', '', '', 30.01, 0, 0); INSERT INTO ConfigurationAdmin VALUES ('u_ThumbnailImageWidth', 'la_section_ImageSettings', 'la_config_ThumbnailImageWidth', 'text', '', '', 30.02, 0, 0); INSERT INTO ConfigurationAdmin VALUES ('u_ThumbnailImageHeight', 'la_section_ImageSettings', 'la_config_ThumbnailImageHeight', 'text', '', '', 30.03, 0, 0); INSERT INTO ConfigurationAdmin VALUES ('u_FullImageWidth', 'la_section_ImageSettings', 'la_config_FullImageWidth', 'text', '', '', 30.04, 0, 0); INSERT INTO ConfigurationAdmin VALUES ('u_FullImageHeight', 'la_section_ImageSettings', 'la_config_FullImageHeight', 'text', '', '', 30.05, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_MaxImageCount', 5, 'In-Portal:Users', 'in-portal:configure_users'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_ThumbnailImageWidth', 120, 'In-Portal:Users', 'in-portal:configure_users'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_ThumbnailImageHeight', 120, 'In-Portal:Users', 'in-portal:configure_users'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_FullImageWidth', 450, 'In-Portal:Users', 'in-portal:configure_users'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_FullImageHeight', 450, 'In-Portal:Users', 'in-portal:configure_users'); CREATE TABLE ChangeLogs ( ChangeLogId bigint(20) NOT NULL auto_increment, PortalUserId int(11) NOT NULL default '0', SessionLogId int(11) NOT NULL default '0', `Action` tinyint(4) NOT NULL default '0', OccuredOn int(11) NOT NULL default '0', Prefix varchar(255) NOT NULL default '', ItemId bigint(20) NOT NULL default '0', Changes text NOT NULL, MasterPrefix varchar(255) NOT NULL default '', MasterId bigint(20) NOT NULL default '0', PRIMARY KEY (ChangeLogId), KEY PortalUserId (PortalUserId), KEY SessionLogId (SessionLogId), KEY `Action` (`Action`), KEY OccuredOn (OccuredOn), KEY Prefix (Prefix), KEY MasterPrefix (MasterPrefix) ); CREATE TABLE SessionLogs ( SessionLogId bigint(20) NOT NULL auto_increment, PortalUserId int(11) NOT NULL default '0', SessionId int(10) NOT NULL default '0', `Status` tinyint(4) NOT NULL default '1', SessionStart int(11) NOT NULL default '0', SessionEnd int(11) default NULL, IP varchar(15) NOT NULL default '', AffectedItems int(11) NOT NULL default '0', PRIMARY KEY (SessionLogId), KEY SessionId (SessionId), KEY `Status` (`Status`), KEY PortalUserId (PortalUserId) ); ALTER TABLE CustomField ADD INDEX (MultiLingual), ADD INDEX (DisplayOrder), ADD INDEX (OnGeneralTab), ADD INDEX (IsSystem); ALTER TABLE ConfigurationAdmin ADD INDEX (DisplayOrder), ADD INDEX (GroupDisplayOrder), ADD INDEX (Install); ALTER TABLE EmailSubscribers ADD INDEX (EmailMessageId), ADD INDEX (PortalUserId); ALTER TABLE Events ADD INDEX (`Type`), ADD INDEX (Enabled); ALTER TABLE Language ADD INDEX (Enabled), ADD INDEX (PrimaryLang), ADD INDEX (AdminInterfaceLang), ADD INDEX (Priority); ALTER TABLE Modules ADD INDEX (Loaded), ADD INDEX (LoadOrder); ALTER TABLE PhraseCache ADD INDEX (CacheDate), ADD INDEX (ThemeId), ADD INDEX (StylesheetId); ALTER TABLE PortalGroup ADD INDEX (CreatedOn); ALTER TABLE PortalUser ADD INDEX (Status), ADD INDEX (Modified), ADD INDEX (dob), ADD INDEX (IsBanned); ALTER TABLE Theme ADD INDEX (Enabled), ADD INDEX (StylesheetId), ADD INDEX (PrimaryTheme); ALTER TABLE UserGroup ADD INDEX (MembershipExpires), ADD INDEX (ExpirationReminderSent); ALTER TABLE EmailLog ADD INDEX (`timestamp`); ALTER TABLE StdDestinations ADD INDEX (DestType), ADD INDEX (DestParentId); ALTER TABLE Category ADD INDEX (Status), ADD INDEX (CreatedOn), ADD INDEX (EditorsPick); ALTER TABLE Stylesheets ADD INDEX (Enabled), ADD INDEX (LastCompiled); ALTER TABLE Counters ADD INDEX (IsClone), ADD INDEX (LifeTime), ADD INDEX (LastCounted); ALTER TABLE Skins ADD INDEX (IsPrimary), ADD INDEX (LastCompiled); INSERT INTO ConfigurationAdmin VALUES ('UseChangeLog', 'la_Text_Website', 'la_config_UseChangeLog', 'checkbox', '', '', 10.25, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseChangeLog', '0', 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationAdmin VALUES ('AutoRefreshIntervals', 'la_Text_Website', 'la_config_AutoRefreshIntervals', 'text', '', '', 10.26, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AutoRefreshIntervals', '1,5,15,30,60,120,240', 'In-Portal', 'in-portal:configure_general'); DELETE FROM Cache WHERE SUBSTRING(VarName, 1, 7) = 'mod_rw_'; ALTER TABLE Category CHANGE `Status` `Status` TINYINT(4) NOT NULL DEFAULT '2'; # ===== v 4.3.1 ===== INSERT INTO ConfigurationAdmin VALUES ('RememberLastAdminTemplate', 'la_Text_General', 'la_config_RememberLastAdminTemplate', 'checkbox', '', '', 10.13, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'RememberLastAdminTemplate', '', 'In-Portal:Users', 'in-portal:configure_users'); INSERT INTO ConfigurationAdmin VALUES ('AllowSelectGroupOnFront', 'la_Text_General', 'la_config_AllowSelectGroupOnFront', 'checkbox', NULL, NULL, 10.13, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AllowSelectGroupOnFront', '0', 'In-Portal:Users', 'in-portal:configure_users'); CREATE TABLE StatisticsCapture ( StatisticsId int(10) unsigned NOT NULL auto_increment, TemplateName varchar(255) NOT NULL default '', Hits int(10) unsigned NOT NULL default '0', LastHit int(11) NOT NULL default '0', ScriptTimeMin decimal(40,20) unsigned NOT NULL default '0.00000000000000000000', ScriptTimeAvg decimal(40,20) unsigned NOT NULL default '0.00000000000000000000', ScriptTimeMax decimal(40,20) unsigned NOT NULL default '0.00000000000000000000', SqlTimeMin decimal(40,20) unsigned NOT NULL default '0.00000000000000000000', SqlTimeAvg decimal(40,20) unsigned NOT NULL default '0.00000000000000000000', SqlTimeMax decimal(40,20) unsigned NOT NULL default '0.00000000000000000000', SqlCountMin decimal(40,20) unsigned NOT NULL default '0.00000000000000000000', SqlCountAvg decimal(40,20) unsigned NOT NULL default '0.00000000000000000000', SqlCountMax decimal(40,20) unsigned NOT NULL default '0.00000000000000000000', PRIMARY KEY (StatisticsId), KEY TemplateName (TemplateName), KEY Hits (Hits), KEY LastHit (LastHit), KEY ScriptTimeMin (ScriptTimeMin), KEY ScriptTimeAvg (ScriptTimeAvg), KEY ScriptTimeMax (ScriptTimeMax), KEY SqlTimeMin (SqlTimeMin), KEY SqlTimeAvg (SqlTimeAvg), KEY SqlTimeMax (SqlTimeMax), KEY SqlCountMin (SqlCountMin), KEY SqlCountAvg (SqlCountAvg), KEY SqlCountMax (SqlCountMax) ); CREATE TABLE SlowSqlCapture ( CaptureId int(10) unsigned NOT NULL auto_increment, TemplateNames text, Hits int(10) unsigned NOT NULL default '0', LastHit int(11) NOT NULL default '0', SqlQuery text, TimeMin decimal(40,20) unsigned NOT NULL default '0.00000000000000000000', TimeAvg decimal(40,20) unsigned NOT NULL default '0.00000000000000000000', TimeMax decimal(40,20) unsigned NOT NULL default '0.00000000000000000000', QueryCrc int(11) NOT NULL default '0', PRIMARY KEY (CaptureId), KEY Hits (Hits), KEY LastHit (LastHit), KEY TimeMin (TimeMin), KEY TimeAvg (TimeAvg), KEY TimeMax (TimeMax), KEY QueryCrc (QueryCrc) ); ALTER TABLE PortalGroup ADD FrontRegistration TINYINT UNSIGNED NOT NULL; UPDATE PortalGroup SET FrontRegistration = 1 WHERE GroupId = 13; INSERT INTO ConfigurationAdmin VALUES ('ForceImageMagickResize', 'la_Text_Website', 'la_config_ForceImageMagickResize', 'checkbox', '', '', 10.28, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'ForceImageMagickResize', '0', 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationAdmin VALUES ('AdminSSL_URL', 'la_Text_Website', 'la_config_AdminSSL_URL', 'text', '', '', 10.091, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AdminSSL_URL', '', 'In-Portal', 'in-portal:configure_general'); # ===== v 4.3.9 ===== ALTER TABLE CustomField CHANGE ValueList ValueList TEXT NULL DEFAULT NULL, ADD DefaultValue VARCHAR(255) NOT NULL AFTER ValueList, ADD INDEX (DefaultValue); UPDATE CustomField SET ValueList = REPLACE(ValueList, ',', '||'); CREATE TABLE Agents ( AgentId int(11) NOT NULL auto_increment, AgentName varchar(255) NOT NULL default '', AgentType tinyint(3) unsigned NOT NULL default '1', Status tinyint(3) unsigned NOT NULL default '1', Event varchar(255) NOT NULL default '', RunInterval int(10) unsigned NOT NULL default '0', RunMode tinyint(3) unsigned NOT NULL default '2', LastRunOn int(10) unsigned default NULL, LastRunStatus tinyint(3) unsigned NOT NULL default '1', NextRunOn int(11) default NULL, RunTime int(10) unsigned NOT NULL default '0', PRIMARY KEY (AgentId), KEY Status (Status), KEY RunInterval (RunInterval), KEY RunMode (RunMode), KEY AgentType (AgentType), KEY LastRunOn (LastRunOn), KEY LastRunStatus (LastRunStatus), KEY RunTime (RunTime), KEY NextRunOn (NextRunOn) ); INSERT INTO Permissions VALUES(DEFAULT, 'in-portal:agents.delete', 11, 1, 1, 0); INSERT INTO Permissions VALUES(DEFAULT, 'in-portal:agents.edit', 11, 1, 1, 0); INSERT INTO Permissions VALUES(DEFAULT, 'in-portal:agents.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES(DEFAULT, 'in-portal:agents.view', 11, 1, 1, 0); INSERT INTO ConfigurationAdmin VALUES ('FilenameSpecialCharReplacement', 'la_Text_General', 'la_config_FilenameSpecialCharReplacement', 'select', NULL, '_=+_,-=+-', 10.16, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'FilenameSpecialCharReplacement', '_', 'In-Portal', 'in-portal:configure_categories'); CREATE TABLE SpellingDictionary ( SpellingDictionaryId int(11) NOT NULL auto_increment, MisspelledWord varchar(255) NOT NULL default '', SuggestedCorrection varchar(255) NOT NULL default '', PRIMARY KEY (SpellingDictionaryId), KEY MisspelledWord (MisspelledWord), KEY SuggestedCorrection (SuggestedCorrection) ); INSERT INTO ConfigurationValues VALUES(NULL, 'YahooApplicationId', '', 'In-Portal', 'in-portal:configure_categories'); INSERT INTO ConfigurationAdmin VALUES('YahooApplicationId', 'la_Text_General', 'la_config_YahooApplicationId', 'text', NULL, NULL, 10.15, 0, 0); CREATE TABLE Thesaurus ( ThesaurusId int(11) NOT NULL auto_increment, SearchTerm varchar(255) NOT NULL default '', ThesaurusTerm varchar(255) NOT NULL default '', ThesaurusType tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (ThesaurusId), KEY ThesaurusType (ThesaurusType), KEY SearchTerm (SearchTerm) ); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:ban_rulelist.delete', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:ban_rulelist.edit', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:ban_rulelist.add', 11, 1, 1, 0); ALTER TABLE Language ADD FilenameReplacements TEXT NULL AFTER UnitSystem; ALTER TABLE Language ADD Locale varchar(10) NOT NULL default 'en-US' AFTER FilenameReplacements; CREATE TABLE LocalesList ( LocaleId int(11) NOT NULL auto_increment, LocaleIdentifier varchar(6) NOT NULL default '', LocaleName varchar(255) NOT NULL default '', Locale varchar(20) NOT NULL default '', ScriptTag varchar(255) NOT NULL default '', ANSICodePage varchar(10) NOT NULL default '', PRIMARY KEY (LocaleId) ); INSERT INTO LocalesList VALUES (1, '0x0436', 'Afrikaans (South Africa)', 'af-ZA', 'Latn', '1252'), (2, '0x041c', 'Albanian (Albania)', 'sq-AL', 'Latn', '1252'), (3, '0x0484', 'Alsatian (France)', 'gsw-FR', '', ''), (4, '0x045e', 'Amharic (Ethiopia)', 'am-ET', '', 'UTF-8'), (5, '0x1401', 'Arabic (Algeria)', 'ar-DZ', 'Arab', '1256'), (6, '0x3c01', 'Arabic (Bahrain)', 'ar-BH', 'Arab', '1256'), (7, '0x0c01', 'Arabic (Egypt)', 'ar-EG', 'Arab', '1256'), (8, '0x0801', 'Arabic (Iraq)', 'ar-IQ', 'Arab', '1256'), (9, '0x2c01', 'Arabic (Jordan)', 'ar-JO', 'Arab', '1256'), (10, '0x3401', 'Arabic (Kuwait)', 'ar-KW', 'Arab', '1256'), (11, '0x3001', 'Arabic (Lebanon)', 'ar-LB', 'Arab', '1256'), (12, '0x1001', 'Arabic (Libya)', 'ar-LY', 'Arab', '1256'), (13, '0x1801', 'Arabic (Morocco)', 'ar-MA', 'Arab', '1256'), (14, '0x2001', 'Arabic (Oman)', 'ar-OM', 'Arab', '1256'), (15, '0x4001', 'Arabic (Qatar)', 'ar-QA', 'Arab', '1256'), (16, '0x0401', 'Arabic (Saudi Arabia)', 'ar-SA', 'Arab', '1256'), (17, '0x2801', 'Arabic (Syria)', 'ar-SY', 'Arab', '1256'), (18, '0x1c01', 'Arabic (Tunisia)', 'ar-TN', 'Arab', '1256'), (19, '0x3801', 'Arabic (U.A.E.)', 'ar-AE', 'Arab', '1256'), (20, '0x2401', 'Arabic (Yemen)', 'ar-YE', 'Arab', '1256'), (21, '0x042b', 'Armenian (Armenia)', 'hy-AM', 'Armn', 'UTF-8'), (22, '0x044d', 'Assamese (India)', 'as-IN', '', 'UTF-8'), (23, '0x082c', 'Azeri (Azerbaijan, Cyrillic)', 'az-Cyrl-AZ', 'Cyrl', '1251'), (24, '0x042c', 'Azeri (Azerbaijan, Latin)', 'az-Latn-AZ', 'Latn', '1254'), (25, '0x046d', 'Bashkir (Russia)', 'ba-RU', '', ''), (26, '0x042d', 'Basque (Basque)', 'eu-ES', 'Latn', '1252'), (27, '0x0423', 'Belarusian (Belarus)', 'be-BY', 'Cyrl', '1251'), (28, '0x0445', 'Bengali (India)', 'bn-IN', 'Beng', 'UTF-8'), (29, '0x201a', 'Bosnian (Bosnia and Herzegovina, Cyrillic)', 'bs-Cyrl-BA', 'Cyrl', '1251'), (30, '0x141a', 'Bosnian (Bosnia and Herzegovina, Latin)', 'bs-Latn-BA', 'Latn', '1250'), (31, '0x047e', 'Breton (France)', 'br-FR', 'Latn', '1252'), (32, '0x0402', 'Bulgarian (Bulgaria)', 'bg-BG', 'Cyrl', '1251'), (33, '0x0403', 'Catalan (Catalan)', 'ca-ES', 'Latn', '1252'), (34, '0x0c04', 'Chinese (Hong Kong SAR, PRC)', 'zh-HK', 'Hant', '950'), (35, '0x1404', 'Chinese (Macao SAR)', 'zh-MO', 'Hant', '950'), (36, '0x0804', 'Chinese (PRC)', 'zh-CN', 'Hans', '936'), (37, '0x1004', 'Chinese (Singapore)', 'zh-SG', 'Hans', '936'), (38, '0x0404', 'Chinese (Taiwan)', 'zh-TW', 'Hant', '950'), (39, '0x101a', 'Croatian (Bosnia and Herzegovina, Latin)', 'hr-BA', 'Latn', '1250'), (40, '0x041a', 'Croatian (Croatia)', 'hr-HR', 'Latn', '1250'), (41, '0x0405', 'Czech (Czech Republic)', 'cs-CZ', 'Latn', '1250'), (42, '0x0406', 'Danish (Denmark)', 'da-DK', 'Latn', '1252'), (43, '0x048c', 'Dari (Afghanistan)', 'prs-AF', 'Arab', '1256'), (44, '0x0465', 'Divehi (Maldives)', 'dv-MV', 'Thaa', 'UTF-8'), (45, '0x0813', 'Dutch (Belgium)', 'nl-BE', 'Latn', '1252'), (46, '0x0413', 'Dutch (Netherlands)', 'nl-NL', 'Latn', '1252'), (47, '0x0c09', 'English (Australia)', 'en-AU', 'Latn', '1252'), (48, '0x2809', 'English (Belize)', 'en-BZ', 'Latn', '1252'), (49, '0x1009', 'English (Canada)', 'en-CA', 'Latn', '1252'), (50, '0x2409', 'English (Caribbean)', 'en-029', 'Latn', '1252'), (51, '0x4009', 'English (India)', 'en-IN', 'Latn', '1252'), (52, '0x1809', 'English (Ireland)', 'en-IE', 'Latn', '1252'), (53, '0x2009', 'English (Jamaica)', 'en-JM', 'Latn', '1252'), (54, '0x4409', 'English (Malaysia)', 'en-MY', 'Latn', '1252'), (55, '0x1409', 'English (New Zealand)', 'en-NZ', 'Latn', '1252'), (56, '0x3409', 'English (Philippines)', 'en-PH', 'Latn', '1252'), (57, '0x4809', 'English (Singapore)', 'en-SG', 'Latn', '1252'), (58, '0x1c09', 'English (South Africa)', 'en-ZA', 'Latn', '1252'), (59, '0x2c09', 'English (Trinidad and Tobago)', 'en-TT', 'Latn', '1252'), (60, '0x0809', 'English (United Kingdom)', 'en-GB', 'Latn', '1252'), (61, '0x0409', 'English (United States)', 'en-US', 'Latn', '1252'), (62, '0x3009', 'English (Zimbabwe)', 'en-ZW', 'Latn', '1252'), (63, '0x0425', 'Estonian (Estonia)', 'et-EE', 'Latn', '1257'), (64, '0x0438', 'Faroese (Faroe Islands)', 'fo-FO', 'Latn', '1252'), (65, '0x0464', 'Filipino (Philippines)', 'fil-PH', 'Latn', '1252'), (66, '0x040b', 'Finnish (Finland)', 'fi-FI', 'Latn', '1252'), (67, '0x080c', 'French (Belgium)', 'fr-BE', 'Latn', '1252'), (68, '0x0c0c', 'French (Canada)', 'fr-CA', 'Latn', '1252'), (69, '0x040c', 'French (France)', 'fr-FR', 'Latn', '1252'), (70, '0x140c', 'French (Luxembourg)', 'fr-LU', 'Latn', '1252'), (71, '0x180c', 'French (Monaco)', 'fr-MC', 'Latn', '1252'), (72, '0x100c', 'French (Switzerland)', 'fr-CH', 'Latn', '1252'), (73, '0x0462', 'Frisian (Netherlands)', 'fy-NL', 'Latn', '1252'), (74, '0x0456', 'Galician (Spain)', 'gl-ES', 'Latn', '1252'), (75, '0x0437', 'Georgian (Georgia)', 'ka-GE', 'Geor', 'UTF-8'), (76, '0x0c07', 'German (Austria)', 'de-AT', 'Latn', '1252'), (77, '0x0407', 'German (Germany)', 'de-DE', 'Latn', '1252'), (78, '0x1407', 'German (Liechtenstein)', 'de-LI', 'Latn', '1252'), (79, '0x1007', 'German (Luxembourg)', 'de-LU', 'Latn', '1252'), (80, '0x0807', 'German (Switzerland)', 'de-CH', 'Latn', '1252'), (81, '0x0408', 'Greek (Greece)', 'el-GR', 'Grek', '1253'), (82, '0x046f', 'Greenlandic (Greenland)', 'kl-GL', 'Latn', '1252'), (83, '0x0447', 'Gujarati (India)', 'gu-IN', 'Gujr', 'UTF-8'), (84, '0x0468', 'Hausa (Nigeria, Latin)', 'ha-Latn-NG', 'Latn', '1252'), (85, '0x040d', 'Hebrew (Israel)', 'he-IL', 'Hebr', '1255'), (86, '0x0439', 'Hindi (India)', 'hi-IN', 'Deva', 'UTF-8'), (87, '0x040e', 'Hungarian (Hungary)', 'hu-HU', 'Latn', '1250'), (88, '0x040f', 'Icelandic (Iceland)', 'is-IS', 'Latn', '1252'), (89, '0x0470', 'Igbo (Nigeria)', 'ig-NG', '', ''), (90, '0x0421', 'Indonesian (Indonesia)', 'id-ID', 'Latn', '1252'), (91, '0x085d', 'Inuktitut (Canada, Latin)', 'iu-Latn-CA', 'Latn', '1252'), (92, '0x045d', 'Inuktitut (Canada, Syllabics)', 'iu-Cans-CA', 'Cans', 'UTF-8'), (93, '0x083c', 'Irish (Ireland)', 'ga-IE', 'Latn', '1252'), (94, '0x0410', 'Italian (Italy)', 'it-IT', 'Latn', '1252'), (95, '0x0810', 'Italian (Switzerland)', 'it-CH', 'Latn', '1252'), (96, '0x0411', 'Japanese (Japan)', 'ja-JP', 'Hani;Hira;Kana', '932'), (97, '0x044b', 'Kannada (India)', 'kn-IN', 'Knda', 'UTF-8'), (98, '0x043f', 'Kazakh (Kazakhstan)', 'kk-KZ', 'Cyrl', '1251'), (99, '0x0453', 'Khmer (Cambodia)', 'kh-KH', 'Khmr', 'UTF-8'), (100, '0x0486', 'K''iche (Guatemala)', 'qut-GT', 'Latn', '1252'), (101, '0x0487', 'Kinyarwanda (Rwanda)', 'rw-RW', 'Latn', '1252'), (102, '0x0457', 'Konkani (India)', 'kok-IN', 'Deva', 'UTF-8'), (103, '0x0812', 'Windows 95, Windows NT 4.0 only: Korean (Johab)', '', '', ''), (104, '0x0412', 'Korean (Korea)', 'ko-KR', 'Hang;Hani', '949'), (105, '0x0440', 'Kyrgyz (Kyrgyzstan)', 'ky-KG', 'Cyrl', '1251'), (106, '0x0454', 'Lao (Lao PDR)', 'lo-LA', 'Laoo', 'UTF-8'), (107, '0x0426', 'Latvian (Latvia)', 'lv-LV', 'Latn', '1257'), (108, '0x0427', 'Lithuanian (Lithuania)', 'lt-LT', 'Latn', '1257'), (109, '0x082e', 'Lower Sorbian (Germany)', 'dsb-DE', 'Latn', '1252'), (110, '0x046e', 'Luxembourgish (Luxembourg)', 'lb-LU', 'Latn', '1252'), (111, '0x042f', 'Macedonian (Macedonia, FYROM)', 'mk-MK', 'Cyrl', '1251'), (112, '0x083e', 'Malay (Brunei Darussalam)', 'ms-BN', 'Latn', '1252'), (113, '0x043e', 'Malay (Malaysia)', 'ms-MY', 'Latn', '1252'), (114, '0x044c', 'Malayalam (India)', 'ml-IN', 'Mlym', 'UTF-8'), (115, '0x043a', 'Maltese (Malta)', 'mt-MT', 'Latn', '1252'), (116, '0x0481', 'Maori (New Zealand)', 'mi-NZ', 'Latn', '1252'), (117, '0x047a', 'Mapudungun (Chile)', 'arn-CL', 'Latn', '1252'), (118, '0x044e', 'Marathi (India)', 'mr-IN', 'Deva', 'UTF-8'), (119, '0x047c', 'Mohawk (Canada)', 'moh-CA', 'Latn', '1252'), (120, '0x0450', 'Mongolian (Mongolia)', 'mn-Cyrl-MN', 'Cyrl', '1251'), (121, '0x0850', 'Mongolian (PRC)', 'mn-Mong-CN', 'Mong', 'UTF-8'), (122, '0x0850', 'Nepali (India)', 'ne-IN', '__', 'UTF-8'), (123, '0x0461', 'Nepali (Nepal)', 'ne-NP', 'Deva', 'UTF-8'), (124, '0x0414', 'Norwegian (Bokmål, Norway)', 'nb-NO', 'Latn', '1252'), (125, '0x0814', 'Norwegian (Nynorsk, Norway)', 'nn-NO', 'Latn', '1252'), (126, '0x0482', 'Occitan (France)', 'oc-FR', 'Latn', '1252'), (127, '0x0448', 'Oriya (India)', 'or-IN', 'Orya', 'UTF-8'), (128, '0x0463', 'Pashto (Afghanistan)', 'ps-AF', '', ''), (129, '0x0429', 'Persian (Iran)', 'fa-IR', 'Arab', '1256'), (130, '0x0415', 'Polish (Poland)', 'pl-PL', 'Latn', '1250'), (131, '0x0416', 'Portuguese (Brazil)', 'pt-BR', 'Latn', '1252'), (132, '0x0816', 'Portuguese (Portugal)', 'pt-PT', 'Latn', '1252'), (133, '0x0446', 'Punjabi (India)', 'pa-IN', 'Guru', 'UTF-8'), (134, '0x046b', 'Quechua (Bolivia)', 'quz-BO', 'Latn', '1252'), (135, '0x086b', 'Quechua (Ecuador)', 'quz-EC', 'Latn', '1252'), (136, '0x0c6b', 'Quechua (Peru)', 'quz-PE', 'Latn', '1252'), (137, '0x0418', 'Romanian (Romania)', 'ro-RO', 'Latn', '1250'), (138, '0x0417', 'Romansh (Switzerland)', 'rm-CH', 'Latn', '1252'), (139, '0x0419', 'Russian (Russia)', 'ru-RU', 'Cyrl', '1251'), (140, '0x243b', 'Sami (Inari, Finland)', 'smn-FI', 'Latn', '1252'), (141, '0x103b', 'Sami (Lule, Norway)', 'smj-NO', 'Latn', '1252'), (142, '0x143b', 'Sami (Lule, Sweden)', 'smj-SE', 'Latn', '1252'), (143, '0x0c3b', 'Sami (Northern, Finland)', 'se-FI', 'Latn', '1252'), (144, '0x043b', 'Sami (Northern, Norway)', 'se-NO', 'Latn', '1252'), (145, '0x083b', 'Sami (Northern, Sweden)', 'se-SE', 'Latn', '1252'), (146, '0x203b', 'Sami (Skolt, Finland)', 'sms-FI', 'Latn', '1252'), (147, '0x183b', 'Sami (Southern, Norway)', 'sma-NO', 'Latn', '1252'), (148, '0x1c3b', 'Sami (Southern, Sweden)', 'sma-SE', 'Latn', '1252'), (149, '0x044f', 'Sanskrit (India)', 'sa-IN', 'Deva', 'UTF-8'), (150, '0x1c1a', 'Serbian (Bosnia and Herzegovina, Cyrillic)', 'sr-Cyrl-BA', 'Cyrl', '1251'), (151, '0x181a', 'Serbian (Bosnia and Herzegovina, Latin)', 'sr-Latn-BA', 'Latn', '1250'), (152, '0x0c1a', 'Serbian (Serbia, Cyrillic)', 'sr-Cyrl-CS', 'Cyrl', '1251'), (153, '0x081a', 'Serbian (Serbia, Latin)', 'sr-Latn-CS', 'Latn', '1250'), (154, '0x046c', 'Sesotho sa Leboa/Northern Sotho (South Africa)', 'ns-ZA', 'Latn', '1252'), (155, '0x0432', 'Setswana/Tswana (South Africa)', 'tn-ZA', 'Latn', '1252'), (156, '0x045b', 'Sinhala (Sri Lanka)', 'si-LK', 'Sinh', 'UTF-8'), (157, '0x041b', 'Slovak (Slovakia)', 'sk-SK', 'Latn', '1250'), (158, '0x0424', 'Slovenian (Slovenia)', 'sl-SI', 'Latn', '1250'), (159, '0x2c0a', 'Spanish (Argentina)', 'es-AR', 'Latn', '1252'), (160, '0x400a', 'Spanish (Bolivia)', 'es-BO', 'Latn', '1252'), (161, '0x340a', 'Spanish (Chile)', 'es-CL', 'Latn', '1252'), (162, '0x240a', 'Spanish (Colombia)', 'es-CO', 'Latn', '1252'), (163, '0x140a', 'Spanish (Costa Rica)', 'es-CR', 'Latn', '1252'), (164, '0x1c0a', 'Spanish (Dominican Republic)', 'es-DO', 'Latn', '1252'), (165, '0x300a', 'Spanish (Ecuador)', 'es-EC', 'Latn', '1252'), (166, '0x440a', 'Spanish (El Salvador)', 'es-SV', 'Latn', '1252'), (167, '0x100a', 'Spanish (Guatemala)', 'es-GT', 'Latn', '1252'), (168, '0x480a', 'Spanish (Honduras)', 'es-HN', 'Latn', '1252'), (169, '0x080a', 'Spanish (Mexico)', 'es-MX', 'Latn', '1252'), (170, '0x4c0a', 'Spanish (Nicaragua)', 'es-NI', 'Latn', '1252'), (171, '0x180a', 'Spanish (Panama)', 'es-PA', 'Latn', '1252'), (172, '0x3c0a', 'Spanish (Paraguay)', 'es-PY', 'Latn', '1252'), (173, '0x280a', 'Spanish (Peru)', 'es-PE', 'Latn', '1252'), (174, '0x500a', 'Spanish (Puerto Rico)', 'es-PR', 'Latn', '1252'), (175, '0x0c0a', 'Spanish (Spain)', 'es-ES', 'Latn', '1252'), (176, '0x040a', 'Spanish (Spain, Traditional Sort)', 'es-ES_tradnl', 'Latn', '1252'), (177, '0x540a', 'Spanish (United States)', 'es-US', '', ''), (178, '0x380a', 'Spanish (Uruguay)', 'es-UY', 'Latn', '1252'), (179, '0x200a', 'Spanish (Venezuela)', 'es-VE', 'Latn', '1252'), (180, '0x0441', 'Swahili (Kenya)', 'sw-KE', 'Latn', '1252'), (181, '0x081d', 'Swedish (Finland)', 'sv-FI', 'Latn', '1252'), (182, '0x041d', 'Swedish (Sweden)', 'sv-SE', 'Latn', '1252'), (183, '0x045a', 'Syriac (Syria)', 'syr-SY', 'Syrc', 'UTF-8'), (184, '0x0428', 'Tajik (Tajikistan)', 'tg-Cyrl-TJ', 'Cyrl', '1251'), (185, '0x085f', 'Tamazight (Algeria, Latin)', 'tzm-Latn-DZ', 'Latn', '1252'), (186, '0x0449', 'Tamil (India)', 'ta-IN', 'Taml', 'UTF-8'), (187, '0x0444', 'Tatar (Russia)', 'tt-RU', 'Cyrl', '1251'), (188, '0x044a', 'Telugu (India)', 'te-IN', 'Telu', 'UTF-8'), (189, '0x041e', 'Thai (Thailand)', 'th-TH', 'Thai', '874'), (190, '0x0851', 'Tibetan (Bhutan)', 'bo-BT', 'Tibt', 'UTF-8'), (191, '0x0451', 'Tibetan (PRC)', 'bo-CN', 'Tibt', 'UTF-8'), (192, '0x041f', 'Turkish (Turkey)', 'tr-TR', 'Latn', '1254'), (193, '0x0442', 'Turkmen (Turkmenistan)', 'tk-TM', 'Cyrl', '1251'), (194, '0x0480', 'Uighur (PRC)', 'ug-CN', 'Arab', '1256'), (195, '0x0422', 'Ukrainian (Ukraine)', 'uk-UA', 'Cyrl', '1251'), (196, '0x042e', 'Upper Sorbian (Germany)', 'wen-DE', 'Latn', '1252'), (197, '0x0820', 'Urdu (India)', 'tr-IN', '', ''), (198, '0x0420', 'Urdu (Pakistan)', 'ur-PK', 'Arab', '1256'), (199, '0x0843', 'Uzbek (Uzbekistan, Cyrillic)', 'uz-Cyrl-UZ', 'Cyrl', '1251'), (200, '0x0443', 'Uzbek (Uzbekistan, Latin)', 'uz-Latn-UZ', 'Latn', '1254'), (201, '0x042a', 'Vietnamese (Vietnam)', 'vi-VN', 'Latn', '1258'), (202, '0x0452', 'Welsh (United Kingdom)', 'cy-GB', 'Latn', '1252'), (203, '0x0488', 'Wolof (Senegal)', 'wo-SN', 'Latn', '1252'), (204, '0x0434', 'Xhosa/isiXhosa (South Africa)', 'xh-ZA', 'Latn', '1252'), (205, '0x0485', 'Yakut (Russia)', 'sah-RU', 'Cyrl', '1251'), (206, '0x0478', 'Yi (PRC)', 'ii-CN', 'Yiii', 'UTF-8'), (207, '0x046a', 'Yoruba (Nigeria)', 'yo-NG', '', ''), (208, '0x0435', 'Zulu/isiZulu (South Africa)', 'zu-ZA', 'Latn', '1252'); UPDATE Phrase SET Module = 'Core' WHERE Module IN ('Proj-Base', 'In-Portal'); UPDATE Phrase SET Module = 'Core' WHERE Phrase IN ('la_fld_Phone', 'la_fld_City', 'la_fld_State', 'la_fld_Zip'); UPDATE Phrase SET Module = 'Core' WHERE Phrase IN ('la_col_Image', 'la_col_Username', 'la_fld_AddressLine1', 'la_fld_AddressLine2', 'la_fld_Comments', 'la_fld_Country', 'la_fld_Email', 'la_fld_Language', 'la_fld_Login', 'la_fld_MessageText', 'la_fld_MetaDescription', 'la_fld_MetaKeywords', 'la_fld_Password', 'la_fld_Username', 'la_fld_Type'); UPDATE Phrase SET Phrase = 'la_Add' WHERE Phrase = 'LA_ADD'; UPDATE Phrase SET Phrase = 'la_col_MembershipExpires' WHERE Phrase = 'la_col_membershipexpires'; UPDATE Phrase SET Phrase = 'la_ShortToolTip_Clone' WHERE Phrase = 'la_shorttooltip_clone'; UPDATE Phrase SET Phrase = 'la_ShortToolTip_Edit' WHERE Phrase = 'LA_SHORTTOOLTIP_EDIT'; UPDATE Phrase SET Phrase = 'la_ShortToolTip_Export' WHERE Phrase = 'LA_SHORTTOOLTIP_EXPORT'; UPDATE Phrase SET Phrase = 'la_ShortToolTip_GoUp' WHERE Phrase = 'LA_SHORTTOOLTIP_GOUP'; UPDATE Phrase SET Phrase = 'la_ShortToolTip_Import' WHERE Phrase = 'LA_SHORTTOOLTIP_IMPORT'; UPDATE Phrase SET Phrase = 'la_ShortToolTip_MoveUp' WHERE Phrase = 'la_shorttooltip_moveup'; UPDATE Phrase SET Phrase = 'la_ShortToolTip_MoveDown' WHERE Phrase = 'la_shorttooltip_movedown'; UPDATE Phrase SET Phrase = 'la_ShortToolTip_RescanThemes' WHERE Phrase = 'la_shorttooltip_rescanthemes'; UPDATE Phrase SET Phrase = 'la_ShortToolTip_SetPrimary' WHERE Phrase = 'LA_SHORTTOOLTIP_SETPRIMARY'; UPDATE Phrase SET Phrase = 'la_ShortToolTip_Rebuild' WHERE Phrase = 'LA_SHORTTOOLTIP_REBUILD'; UPDATE Phrase SET Phrase = 'la_Tab_Service' WHERE Phrase = 'la_tab_service'; UPDATE Phrase SET Phrase = 'la_tab_Files' WHERE Phrase = 'la_tab_files'; UPDATE Phrase SET Phrase = 'la_ToolTipShort_Edit_Current_Category' WHERE Phrase = 'LA_TOOLTIPSHORT_EDIT_CURRENT_CATEGORY'; UPDATE Phrase SET Phrase = 'la_ToolTip_Add' WHERE Phrase = 'LA_TOOLTIP_ADD'; UPDATE Phrase SET Phrase = 'la_ToolTip_Add_Product' WHERE Phrase = 'LA_TOOLTIP_ADD_PRODUCT'; UPDATE Phrase SET Phrase = 'la_ToolTip_NewSearchConfig' WHERE Phrase = 'LA_TOOLTIP_NEWSEARCHCONFIG'; UPDATE Phrase SET Phrase = 'la_ToolTip_Prev' WHERE Phrase = 'la_tooltip_prev'; UPDATE Phrase SET Phrase = 'la_Invalid_Password' WHERE Phrase = 'la_invalid_password'; UPDATE Events SET Module = REPLACE(Module, 'In-Portal', 'Core'); DROP TABLE ImportScripts; CREATE TABLE BanRules ( RuleId int(11) NOT NULL auto_increment, RuleType tinyint(4) NOT NULL default '0', ItemField varchar(255) default NULL, ItemVerb tinyint(4) NOT NULL default '0', ItemValue varchar(255) NOT NULL default '', ItemType int(11) NOT NULL default '0', Priority int(11) NOT NULL default '0', Status tinyint(4) NOT NULL default '1', ErrorTag varchar(255) default NULL, PRIMARY KEY (RuleId), KEY Status (Status), KEY Priority (Priority), KEY ItemType (ItemType) ); CREATE TABLE CountCache ( ListType int(11) NOT NULL default '0', ItemType int(11) NOT NULL default '-1', Value int(11) NOT NULL default '0', CountCacheId int(11) NOT NULL auto_increment, LastUpdate int(11) NOT NULL default '0', ExtraId varchar(50) default NULL, TodayOnly tinyint(4) NOT NULL default '0', PRIMARY KEY (CountCacheId) ); CREATE TABLE Favorites ( FavoriteId int(11) NOT NULL auto_increment, PortalUserId int(11) NOT NULL default '0', ResourceId int(11) NOT NULL default '0', ItemTypeId int(11) NOT NULL default '0', Modified int(11) NOT NULL default '0', PRIMARY KEY (FavoriteId), UNIQUE KEY main (PortalUserId,ResourceId), KEY Modified (Modified), KEY ItemTypeId (ItemTypeId) ); CREATE TABLE Images ( ImageId int(11) NOT NULL auto_increment, ResourceId int(11) NOT NULL default '0', Url varchar(255) NOT NULL default '', Name varchar(255) NOT NULL default '', AltName VARCHAR(255) NOT NULL DEFAULT '', ImageIndex int(11) NOT NULL default '0', LocalImage tinyint(4) NOT NULL default '1', LocalPath varchar(240) NOT NULL default '', Enabled int(11) NOT NULL default '1', DefaultImg int(11) NOT NULL default '0', ThumbUrl varchar(255) default NULL, Priority int(11) NOT NULL default '0', ThumbPath varchar(255) default NULL, LocalThumb tinyint(4) NOT NULL default '1', SameImages tinyint(4) NOT NULL default '1', PRIMARY KEY (ImageId), KEY ResourceId (ResourceId), KEY Enabled (Enabled), KEY Priority (Priority) ); CREATE TABLE ItemRating ( RatingId int(11) NOT NULL auto_increment, IPAddress varchar(255) NOT NULL default '', CreatedOn INT UNSIGNED NULL DEFAULT NULL, RatingValue int(11) NOT NULL default '0', ItemId int(11) NOT NULL default '0', PRIMARY KEY (RatingId), KEY CreatedOn (CreatedOn), KEY ItemId (ItemId), KEY RatingValue (RatingValue) ); CREATE TABLE ItemReview ( ReviewId int(11) NOT NULL auto_increment, CreatedOn INT UNSIGNED NULL DEFAULT NULL, ReviewText longtext NOT NULL, Rating tinyint(3) unsigned default NULL, IPAddress varchar(255) NOT NULL default '', ItemId int(11) NOT NULL default '0', CreatedById int(11) NOT NULL default '-1', ItemType tinyint(4) NOT NULL default '0', Priority int(11) NOT NULL default '0', Status tinyint(4) NOT NULL default '2', TextFormat int(11) NOT NULL default '0', Module varchar(255) NOT NULL default '', PRIMARY KEY (ReviewId), KEY CreatedOn (CreatedOn), KEY ItemId (ItemId), KEY ItemType (ItemType), KEY Priority (Priority), KEY Status (Status) ); CREATE TABLE ItemTypes ( ItemType int(11) NOT NULL default '0', Module varchar(50) NOT NULL default '', Prefix varchar(20) NOT NULL default '', SourceTable varchar(100) NOT NULL default '', TitleField varchar(50) default NULL, CreatorField varchar(255) NOT NULL default '', PopField varchar(255) default NULL, RateField varchar(255) default NULL, LangVar varchar(255) NOT NULL default '', PrimaryItem int(11) NOT NULL default '0', EditUrl varchar(255) NOT NULL default '', ClassName varchar(40) NOT NULL default '', ItemName varchar(50) NOT NULL default '', PRIMARY KEY (ItemType), KEY Module (Module) ); CREATE TABLE ItemFiles ( FileId int(11) NOT NULL auto_increment, ResourceId int(11) unsigned NOT NULL default '0', FileName varchar(255) NOT NULL default '', FilePath varchar(255) NOT NULL default '', Size int(11) NOT NULL default '0', `Status` tinyint(4) NOT NULL default '1', CreatedOn int(11) unsigned NOT NULL default '0', CreatedById int(11) NOT NULL default '-1', MimeType varchar(255) NOT NULL default '', PRIMARY KEY (FileId), KEY ResourceId (ResourceId), KEY CreatedOn (CreatedOn), KEY Status (Status) ); CREATE TABLE Relationship ( RelationshipId int(11) NOT NULL auto_increment, SourceId int(11) default NULL, TargetId int(11) default NULL, SourceType tinyint(4) NOT NULL default '0', TargetType tinyint(4) NOT NULL default '0', Type int(11) NOT NULL default '0', Enabled int(11) NOT NULL default '1', Priority int(11) NOT NULL default '0', PRIMARY KEY (RelationshipId), KEY RelSource (SourceId), KEY RelTarget (TargetId), KEY `Type` (`Type`), KEY Enabled (Enabled), KEY Priority (Priority), KEY SourceType (SourceType), KEY TargetType (TargetType) ); CREATE TABLE SearchConfig ( TableName varchar(40) NOT NULL default '', FieldName varchar(40) NOT NULL default '', SimpleSearch tinyint(4) NOT NULL default '1', AdvancedSearch tinyint(4) NOT NULL default '1', Description varchar(255) default NULL, DisplayName varchar(80) default NULL, ModuleName VARCHAR(20) NOT NULL DEFAULT 'In-Portal', ConfigHeader varchar(255) default NULL, DisplayOrder int(11) NOT NULL default '0', SearchConfigId int(11) NOT NULL auto_increment, Priority int(11) NOT NULL default '0', FieldType varchar(20) NOT NULL default 'text', ForeignField TEXT, JoinClause TEXT, IsWhere text, IsNotWhere text, ContainsWhere text, NotContainsWhere text, CustomFieldId int(11) default NULL, PRIMARY KEY (SearchConfigId), KEY SimpleSearch (SimpleSearch), KEY AdvancedSearch (AdvancedSearch), KEY DisplayOrder (DisplayOrder), KEY Priority (Priority), KEY CustomFieldId (CustomFieldId) ); CREATE TABLE SearchLog ( SearchLogId int(11) NOT NULL auto_increment, Keyword varchar(255) NOT NULL default '', Indices bigint(20) NOT NULL default '0', SearchType int(11) NOT NULL default '0', PRIMARY KEY (SearchLogId), KEY SearchType (SearchType) ); CREATE TABLE IgnoreKeywords ( keyword varchar(20) NOT NULL default '', PRIMARY KEY (keyword) ); CREATE TABLE SpamControl ( ItemResourceId int(11) NOT NULL default '0', IPaddress varchar(20) NOT NULL default '', Expire INT UNSIGNED NULL DEFAULT NULL, PortalUserId int(11) NOT NULL default '0', DataType varchar(20) default NULL, KEY PortalUserId (PortalUserId), KEY Expire (Expire), KEY ItemResourceId (ItemResourceId) ); CREATE TABLE StatItem ( StatItemId int(11) NOT NULL auto_increment, Module varchar(20) NOT NULL default '', ValueSQL varchar(255) default NULL, ResetSQL varchar(255) default NULL, ListLabel varchar(255) NOT NULL default '', Priority int(11) NOT NULL default '0', AdminSummary int(11) NOT NULL default '0', PRIMARY KEY (StatItemId), KEY AdminSummary (AdminSummary), KEY Priority (Priority) ); CREATE TABLE SuggestMail ( email varchar(255) NOT NULL default '', sent INT UNSIGNED NULL DEFAULT NULL, PRIMARY KEY (email), KEY sent (sent) ); CREATE TABLE SysCache ( SysCacheId int(11) NOT NULL auto_increment, Name varchar(255) NOT NULL default '', Value mediumtext, Expire INT UNSIGNED NULL DEFAULT NULL, Module varchar(20) default NULL, Context varchar(255) default NULL, GroupList varchar(255) NOT NULL default '', PRIMARY KEY (SysCacheId), KEY Name (Name) ); CREATE TABLE TagLibrary ( TagId int(11) NOT NULL auto_increment, name varchar(255) NOT NULL default '', description text, example text, scope varchar(20) NOT NULL default 'global', PRIMARY KEY (TagId) ); CREATE TABLE TagAttributes ( AttrId int(11) NOT NULL auto_increment, TagId int(11) NOT NULL default '0', Name varchar(255) NOT NULL default '', AttrType varchar(20) default NULL, DefValue varchar(255) default NULL, Description TEXT, Required int(11) NOT NULL default '0', PRIMARY KEY (AttrId), KEY TagId (TagId) ); CREATE TABLE ImportScripts ( ImportId INT(11) NOT NULL auto_increment, Name VARCHAR(255) NOT NULL DEFAULT '', Description TEXT NOT NULL, Prefix VARCHAR(10) NOT NULL DEFAULT '', Module VARCHAR(50) NOT NULL DEFAULT '', ExtraFields VARCHAR(255) NOT NULL DEFAULT '', Type VARCHAR(10) NOT NULL DEFAULT '', Status TINYINT NOT NULL, PRIMARY KEY (ImportId), KEY Module (Module), KEY Status (Status) ); CREATE TABLE StylesheetSelectors ( SelectorId int(11) NOT NULL auto_increment, StylesheetId int(11) NOT NULL default '0', Name varchar(255) NOT NULL default '', SelectorName varchar(255) NOT NULL default '', SelectorData text NOT NULL, Description text NOT NULL, Type tinyint(4) NOT NULL default '0', AdvancedCSS text NOT NULL, ParentId int(11) NOT NULL default '0', PRIMARY KEY (SelectorId), KEY StylesheetId (StylesheetId), KEY ParentId (ParentId), KEY `Type` (`Type`) ); CREATE TABLE Visits ( VisitId int(11) NOT NULL auto_increment, VisitDate int(10) unsigned NOT NULL default '0', Referer varchar(255) NOT NULL default '', IPAddress varchar(15) NOT NULL default '', AffiliateId int(10) unsigned NOT NULL default '0', PortalUserId int(11) NOT NULL default '-2', PRIMARY KEY (VisitId), KEY PortalUserId (PortalUserId), KEY AffiliateId (AffiliateId), KEY VisitDate (VisitDate) ); CREATE TABLE ImportCache ( CacheId int(11) NOT NULL auto_increment, CacheName varchar(255) NOT NULL default '', VarName int(11) NOT NULL default '0', VarValue text NOT NULL, PRIMARY KEY (CacheId), KEY CacheName (CacheName), KEY VarName (VarName) ); CREATE TABLE RelatedSearches ( RelatedSearchId int(11) NOT NULL auto_increment, ResourceId int(11) NOT NULL default '0', Keyword varchar(255) NOT NULL default '', ItemType tinyint(4) NOT NULL default '0', Enabled tinyint(4) NOT NULL default '1', Priority int(11) NOT NULL default '0', PRIMARY KEY (RelatedSearchId), KEY Enabled (Enabled), KEY ItemType (ItemType), KEY ResourceId (ResourceId) ); UPDATE Modules SET Path = 'core/', Version='4.3.9' WHERE Name = 'In-Portal'; UPDATE Skins SET Logo = 'just_logo.gif' WHERE Logo = 'just_logo_1.gif'; UPDATE ConfigurationAdmin SET prompt = 'la_config_PathToWebsite' WHERE VariableName = 'Site_Path'; # ===== v 5.0.0 ===== CREATE TABLE StopWords ( StopWordId int(11) NOT NULL auto_increment, StopWord varchar(255) NOT NULL default '', PRIMARY KEY (StopWordId), KEY StopWord (StopWord) ); INSERT INTO StopWords VALUES (90, '~'),(152, 'on'),(157, 'see'),(156, 'put'),(128, 'and'),(154, 'or'),(155, 'other'),(153, 'one'),(126, 'as'),(127, 'at'),(125, 'are'),(91, '!'),(92, '@'),(93, '#'),(94, '$'),(95, '%'),(96, '^'),(97, '&'),(98, '*'),(99, '('),(100, ')'),(101, '-'),(102, '_'),(103, '='),(104, '+'),(105, '['),(106, '{'),(107, ']'),(108, '}'),(109, '\\'),(110, '|'),(111, ';'),(112, ':'),(113, ''''),(114, '"'),(115, '<'),(116, '.'),(117, '>'),(118, '/'),(119, '?'),(120, 'ah'),(121, 'all'),(122, 'also'),(123, 'am'),(124, 'an'),(151, 'of'),(150, 'note'),(149, 'not'),(148, 'no'),(147, 'may'),(146, 'its'),(145, 'it'),(144, 'is'),(143, 'into'),(142, 'in'),(141, 'had'),(140, 'has'),(139, 'have'),(138, 'from'),(137, 'form'),(136, 'for'),(135, 'end'),(134, 'each'),(133, 'can'),(132, 'by'),(130, 'be'),(131, 'but'),(129, 'any'),(158, 'that'),(159, 'the'),(160, 'their'),(161, 'there'),(162, 'these'),(163, 'they'),(164, 'this'),(165, 'through'),(166, 'thus'),(167, 'to'),(168, 'two'),(169, 'too'),(170, 'up'),(171, 'where'),(172, 'which'),(173, 'with'),(174, 'were'),(175, 'was'),(176, 'you'),(177, 'yet'); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:stop_words.view', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:stop_words.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:stop_words.edit', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:stop_words.delete', 11, 1, 1, 0); INSERT INTO ConfigurationAdmin VALUES ('CheckStopWords', 'la_Text_Website', 'la_config_CheckStopWords', 'checkbox', '', '', 10.29, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CheckStopWords', '0', 'In-Portal', 'in-portal:configure_general'); ALTER TABLE SpamControl ADD INDEX (DataType); CREATE TABLE MailingLists ( MailingId int(10) unsigned NOT NULL auto_increment, PortalUserId int(11) NOT NULL default '-1', `To` longtext, ToParsed longtext, Attachments text, `Subject` varchar(255) NOT NULL, MessageText longtext, MessageHtml longtext, `Status` tinyint(3) unsigned NOT NULL default '1', EmailsQueued int(10) unsigned NOT NULL, EmailsSent int(10) unsigned NOT NULL, EmailsTotal int(10) unsigned NOT NULL, PRIMARY KEY (MailingId), KEY EmailsTotal (EmailsTotal), KEY EmailsSent (EmailsSent), KEY EmailsQueued (EmailsQueued), KEY `Status` (`Status`), KEY PortalUserId (PortalUserId) ); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mailing_lists.view', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mailing_lists.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mailing_lists.edit', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mailing_lists.delete', 11, 1, 1, 0); ALTER TABLE EmailQueue ADD MailingId INT UNSIGNED NOT NULL, ADD INDEX (MailingId); INSERT INTO ConfigurationAdmin VALUES ('MailingListQueuePerStep', 'la_Text_smtp_server', 'la_config_MailingListQueuePerStep', 'text', NULL, NULL, 30.09, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'MailingListQueuePerStep', 10, 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationAdmin VALUES ('MailingListSendPerStep', 'la_Text_smtp_server', 'la_config_MailingListSendPerStep', 'text', NULL, NULL, 30.10, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'MailingListSendPerStep', 10, 'In-Portal', 'in-portal:configure_general'); ALTER TABLE Events ADD INDEX (Event); ALTER TABLE SearchLog ADD INDEX (Keyword); ALTER TABLE Skins ADD LogoBottom VARCHAR(255) NOT NULL AFTER Logo, ADD LogoLogin VARCHAR(255) NOT NULL AFTER LogoBottom; UPDATE Skins SET Logo = 'in-portal_logo_img.jpg', LogoBottom = 'in-portal_logo_img2.jpg', LogoLogin = 'in-portal_logo_login.gif' WHERE Logo = 'just_logo_1.gif' OR Logo = 'just_logo.gif'; INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SiteNameSubTitle', '', 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationAdmin VALUES ('SiteNameSubTitle', 'la_Text_Website', 'la_config_SiteNameSubTitle', 'text', '', '', 10.021, 0, 0); INSERT INTO ConfigurationAdmin VALUES ('ResizableFrames', 'la_Text_Website', 'la_config_ResizableFrames', 'checkbox', '', '', 10.30, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'ResizableFrames', '0', 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationAdmin VALUES ('QuickCategoryPermissionRebuild', 'la_Text_General', 'la_config_QuickCategoryPermissionRebuild', 'checkbox', NULL , NULL , 10.12, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'QuickCategoryPermissionRebuild', '1', 'In-Portal', 'in-portal:configure_categories'); ALTER TABLE Language ADD UserDocsUrl VARCHAR(255) NOT NULL; UPDATE Category SET Template = CategoryTemplate WHERE CategoryTemplate <> ''; ALTER TABLE Category ADD ThemeId INT UNSIGNED NOT NULL, ADD INDEX (ThemeId), ADD COLUMN UseExternalUrl tinyint(3) unsigned NOT NULL default '0' AFTER Template, ADD COLUMN ExternalUrl varchar(255) NOT NULL default '' AFTER UseExternalUrl, ADD COLUMN UseMenuIconUrl tinyint(3) unsigned NOT NULL default '0' AFTER ExternalUrl, ADD COLUMN MenuIconUrl varchar(255) NOT NULL default '' AFTER UseMenuIconUrl, CHANGE MetaKeywords MetaKeywords TEXT, CHANGE MetaDescription MetaDescription TEXT, CHANGE CachedCategoryTemplate CachedTemplate VARCHAR(255) NOT NULL, DROP CategoryTemplate; UPDATE Category SET l1_MenuTitle = l1_Name WHERE l1_MenuTitle = '' OR l1_MenuTitle LIKE '_Auto: %'; UPDATE Category SET l2_MenuTitle = l2_Name WHERE l2_MenuTitle = '' OR l2_MenuTitle LIKE '_Auto: %'; UPDATE Category SET l3_MenuTitle = l3_Name WHERE l3_MenuTitle = '' OR l3_MenuTitle LIKE '_Auto: %'; UPDATE Category SET l4_MenuTitle = l4_Name WHERE l4_MenuTitle = '' OR l4_MenuTitle LIKE '_Auto: %'; UPDATE Category SET l5_MenuTitle = l5_Name WHERE l5_MenuTitle = '' OR l5_MenuTitle LIKE '_Auto: %'; UPDATE Category SET Template = '/platform/designs/general' WHERE Template = '/in-edit/designs/general'; UPDATE Category SET CachedTemplate = '/platform/designs/general' WHERE CachedTemplate = '/in-edit/designs/general'; UPDATE Category SET CachedTemplate = Template WHERE Template <> ''; CREATE TABLE PageContent ( PageContentId int(11) NOT NULL auto_increment, ContentNum int(11) NOT NULL default '0', PageId int(11) NOT NULL default '0', l1_Content text, l2_Content text, l3_Content text, l4_Content text, l5_Content text, l1_Translated tinyint(4) NOT NULL default '0', l2_Translated tinyint(4) NOT NULL default '0', l3_Translated tinyint(4) NOT NULL default '0', l4_Translated tinyint(4) NOT NULL default '0', l5_Translated tinyint(4) NOT NULL default '0', PRIMARY KEY (PageContentId), KEY ContentNum (ContentNum,PageId) ); CREATE TABLE FormFields ( FormFieldId int(11) NOT NULL auto_increment, FormId int(11) NOT NULL default '0', Type int(11) NOT NULL default '0', FieldName varchar(255) NOT NULL default '', FieldLabel varchar(255) default NULL, Heading varchar(255) default NULL, Prompt varchar(255) default NULL, ElementType varchar(50) NOT NULL default '', ValueList varchar(255) default NULL, Priority int(11) NOT NULL default '0', IsSystem tinyint(3) unsigned NOT NULL default '0', Required tinyint(1) NOT NULL default '0', DisplayInGrid tinyint(1) NOT NULL default '1', DefaultValue text NOT NULL, Validation TINYINT NOT NULL DEFAULT '0', PRIMARY KEY (FormFieldId), KEY `Type` (`Type`), KEY FormId (FormId), KEY Priority (Priority), KEY IsSystem (IsSystem), KEY DisplayInGrid (DisplayInGrid) ); CREATE TABLE FormSubmissions ( FormSubmissionId int(11) NOT NULL auto_increment, FormId int(11) NOT NULL default '0', SubmissionTime int(11) NOT NULL default '0', PRIMARY KEY (FormSubmissionId), KEY FormId (FormId), KEY SubmissionTime (SubmissionTime) ); CREATE TABLE Forms ( FormId int(11) NOT NULL auto_increment, Title VARCHAR(255) NOT NULL DEFAULT '', Description text, PRIMARY KEY (FormId) ); UPDATE Events SET Module = 'Core:Category', Description = 'la_event_FormSubmitted' WHERE Event = 'FORM.SUBMITTED'; DELETE FROM PersistantSessionData WHERE VariableName LIKE '%img%'; UPDATE Modules SET TemplatePath = Path WHERE TemplatePath <> ''; UPDATE ConfigurationValues SET VariableValue = '/platform/designs/general' WHERE VariableName = 'cms_DefaultDesign'; UPDATE ConfigurationValues SET ModuleOwner = 'In-Portal', Section = 'in-portal:configure_categories' WHERE VariableName = 'cms_DefaultDesign'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.15 WHERE VariableName = 'cms_DefaultDesign'; UPDATE Phrase SET Phrase = 'la_Regular' WHERE Phrase = 'la_regular'; UPDATE Phrase SET Module = 'Core' WHERE Phrase IN ('la_Hide', 'la_Show', 'la_fld_Requied', 'la_col_Modified', 'la_col_Referer', 'la_Regular'); UPDATE Phrase SET Phrase = 'la_title_Editing_E-mail' WHERE Phrase = 'la_title_editing_e-mail'; ALTER TABLE Phrase ADD UNIQUE (LanguageId, Phrase); ALTER TABLE CustomField ADD IsRequired tinyint(3) unsigned NOT NULL default '0'; DELETE FROM Permissions WHERE (Permission LIKE 'proj-cms:structure%') OR (Permission LIKE 'proj-cms:submissions%') OR (Permission LIKE 'proj-base:users%') OR (Permission LIKE 'proj-base:system_variables%') OR (Permission LIKE 'proj-base:email_settings%') OR (Permission LIKE 'proj-base:other_settings%') OR (Permission LIKE 'proj-base:sysconfig%'); UPDATE Permissions SET Permission = REPLACE(Permission, 'proj-cms:browse', 'in-portal:browse_site'); UPDATE Permissions SET Permission = REPLACE(Permission, 'proj-cms:', 'in-portal:'); UPDATE Permissions SET Permission = REPLACE(Permission, 'proj-base:', 'in-portal:'); ALTER TABLE CategoryItems ADD INDEX (ItemResourceId); ALTER TABLE CategoryItems DROP INDEX Filename; ALTER TABLE CategoryItems ADD INDEX Filename(Filename); DROP TABLE Pages; DELETE FROM PermissionConfig WHERE PermissionName LIKE 'PAGE.%'; DELETE FROM Permissions WHERE Permission LIKE 'PAGE.%'; DELETE FROM SearchConfig WHERE TableName = 'Pages'; DELETE FROM ConfigurationAdmin WHERE VariableName LIKE '%_pages'; DELETE FROM ConfigurationValues WHERE VariableName LIKE '%_pages'; DELETE FROM ConfigurationAdmin WHERE VariableName LIKE 'PerPage_Pages%'; DELETE FROM ConfigurationValues WHERE VariableName LIKE 'PerPage_Pages%'; INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:website_setting_folder.view', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:user_setting_folder.view', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_advanced.view', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:configure_advanced.edit', 11, 1, 1, 0); #INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:spelling_dictionary.delete', 11, 1, 1, 0); #INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:spelling_dictionary.edit', 11, 1, 1, 0); #INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:spelling_dictionary.add', 11, 1, 1, 0); #INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:spelling_dictionary.view', 11, 1, 1, 0); UPDATE ConfigurationValues SET ModuleOwner = 'In-Portal', Section = 'in-portal:configure_general' WHERE ModuleOwner = 'Proj-Base' AND Section IN ('proj-base:system_variables', 'proj-base:email_settings'); UPDATE ConfigurationValues SET ModuleOwner = 'In-Portal', Section = 'in-portal:configure_advanced' WHERE ModuleOwner = 'Proj-Base' AND Section IN ('proj-base:other_settings', 'proj-base:sysconfig'); UPDATE ConfigurationAdmin SET heading = 'la_Text_General' WHERE VariableName IN ('AdvancedUserManagement', 'RememberLastAdminTemplate', 'DefaultSettingsUserId'); UPDATE ConfigurationAdmin SET DisplayOrder = 10.011 WHERE VariableName = 'AdvancedUserManagement'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.14 WHERE VariableName = 'RememberLastAdminTemplate'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.15 WHERE VariableName = 'DefaultSettingsUserId'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.13 WHERE VariableName = 'FilenameSpecialCharReplacement'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.14 WHERE VariableName = 'YahooApplicationId'; UPDATE ConfigurationAdmin SET heading = 'la_section_SettingsMailling', prompt = 'la_prompt_AdminMailFrom', ValueList = 'size="40"', DisplayOrder = 30.07 WHERE VariableName = 'Smtp_AdminMailFrom'; UPDATE ConfigurationAdmin SET heading = 'la_section_SettingsWebsite' WHERE VariableName IN ('Site_Path','SiteNameSubTitle','UseModRewrite','Config_Server_Time','Config_Site_Time','ErrorTemplate','NoPermissionTemplate','UsePageHitCounter','ForceImageMagickResize','CheckStopWords','Site_Name'); UPDATE ConfigurationAdmin SET heading = 'la_section_SettingsSession' WHERE VariableName IN ('CookieSessions','SessionCookieName','SessionTimeout','KeepSessionOnBrowserClose','SessionReferrerCheck','UseJSRedirect'); UPDATE ConfigurationAdmin SET heading = 'la_section_SettingsSSL' WHERE VariableName IN ('SSL_URL','AdminSSL_URL','Require_SSL','Require_AdminSSL','Force_HTTP_When_SSL_Not_Required','UseModRewriteWithSSL'); UPDATE ConfigurationAdmin SET heading = 'la_section_SettingsAdmin' WHERE VariableName IN ('UseToolbarLabels','UseSmallHeader','UseColumnFreezer','UsePopups','UseDoubleSorting','MenuFrameWidth','ResizableFrames','AutoRefreshIntervals'); UPDATE ConfigurationAdmin SET heading = 'la_section_SettingsMailling' WHERE VariableName IN ('Smtp_Server','Smtp_Port','Smtp_Authenticate','Smtp_User','Smtp_Pass','Smtp_DefaultHeaders','MailFunctionHeaderSeparator','MailingListQueuePerStep','MailingListSendPerStep'); UPDATE ConfigurationAdmin SET heading = 'la_section_SettingsSystem' WHERE VariableName IN ('UseOutputCompression','OutputCompressionLevel','TrimRequiredFields','UseCronForRegularEvent','UseChangeLog','Backup_Path','SystemTagCache','SocketBlockingMode'); UPDATE ConfigurationAdmin SET heading = 'la_section_SettingsCSVExport' WHERE VariableName IN ('CSVExportDelimiter','CSVExportEnclosure','CSVExportSeparator','CSVExportEncoding'); UPDATE ConfigurationAdmin SET DisplayOrder = 10.01 WHERE VariableName = 'Site_Path'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.02 WHERE VariableName = 'SiteNameSubTitle'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.03 WHERE VariableName = 'UseModRewrite'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.04 WHERE VariableName = 'Config_Server_Time'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.05 WHERE VariableName = 'Config_Site_Time'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.06 WHERE VariableName = 'ErrorTemplate'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.07 WHERE VariableName = 'NoPermissionTemplate'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.08 WHERE VariableName = 'UsePageHitCounter'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.09 WHERE VariableName = 'ForceImageMagickResize'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.10 WHERE VariableName = 'CheckStopWords'; UPDATE ConfigurationAdmin SET DisplayOrder = 20.01 WHERE VariableName = 'CookieSessions'; UPDATE ConfigurationAdmin SET DisplayOrder = 20.02 WHERE VariableName = 'SessionCookieName'; UPDATE ConfigurationAdmin SET DisplayOrder = 20.03 WHERE VariableName = 'SessionTimeout'; UPDATE ConfigurationAdmin SET DisplayOrder = 20.04 WHERE VariableName = 'KeepSessionOnBrowserClose'; UPDATE ConfigurationAdmin SET DisplayOrder = 20.05 WHERE VariableName = 'SessionReferrerCheck'; UPDATE ConfigurationAdmin SET DisplayOrder = 20.06 WHERE VariableName = 'UseJSRedirect'; UPDATE ConfigurationAdmin SET DisplayOrder = 30.01 WHERE VariableName = 'SSL_URL'; UPDATE ConfigurationAdmin SET DisplayOrder = 30.02 WHERE VariableName = 'AdminSSL_URL'; UPDATE ConfigurationAdmin SET DisplayOrder = 30.03 WHERE VariableName = 'Require_SSL'; UPDATE ConfigurationAdmin SET DisplayOrder = 30.04 WHERE VariableName = 'Require_AdminSSL'; UPDATE ConfigurationAdmin SET DisplayOrder = 30.05 WHERE VariableName = 'Force_HTTP_When_SSL_Not_Required'; UPDATE ConfigurationAdmin SET DisplayOrder = 30.06 WHERE VariableName = 'UseModRewriteWithSSL'; UPDATE ConfigurationAdmin SET DisplayOrder = 40.01 WHERE VariableName = 'UseToolbarLabels'; UPDATE ConfigurationAdmin SET DisplayOrder = 40.02 WHERE VariableName = 'UseSmallHeader'; UPDATE ConfigurationAdmin SET DisplayOrder = 40.03 WHERE VariableName = 'UseColumnFreezer'; UPDATE ConfigurationAdmin SET DisplayOrder = 40.04 WHERE VariableName = 'UsePopups'; UPDATE ConfigurationAdmin SET DisplayOrder = 40.05 WHERE VariableName = 'UseDoubleSorting'; UPDATE ConfigurationAdmin SET DisplayOrder = 40.06 WHERE VariableName = 'MenuFrameWidth'; UPDATE ConfigurationAdmin SET DisplayOrder = 40.07 WHERE VariableName = 'ResizableFrames'; UPDATE ConfigurationAdmin SET DisplayOrder = 40.08 WHERE VariableName = 'AutoRefreshIntervals'; UPDATE ConfigurationAdmin SET DisplayOrder = 50.01 WHERE VariableName = 'Smtp_Server'; UPDATE ConfigurationAdmin SET DisplayOrder = 50.02 WHERE VariableName = 'Smtp_Port'; UPDATE ConfigurationAdmin SET DisplayOrder = 50.03 WHERE VariableName = 'Smtp_Authenticate'; UPDATE ConfigurationAdmin SET DisplayOrder = 50.04 WHERE VariableName = 'Smtp_User'; UPDATE ConfigurationAdmin SET DisplayOrder = 50.05 WHERE VariableName = 'Smtp_Pass'; UPDATE ConfigurationAdmin SET DisplayOrder = 50.06 WHERE VariableName = 'Smtp_DefaultHeaders'; UPDATE ConfigurationAdmin SET DisplayOrder = 50.07 WHERE VariableName = 'MailFunctionHeaderSeparator'; UPDATE ConfigurationAdmin SET DisplayOrder = 50.08 WHERE VariableName = 'MailingListQueuePerStep'; UPDATE ConfigurationAdmin SET DisplayOrder = 50.09 WHERE VariableName = 'MailingListSendPerStep'; UPDATE ConfigurationAdmin SET DisplayOrder = 60.01 WHERE VariableName = 'UseOutputCompression'; UPDATE ConfigurationAdmin SET DisplayOrder = 60.02 WHERE VariableName = 'OutputCompressionLevel'; UPDATE ConfigurationAdmin SET DisplayOrder = 60.03 WHERE VariableName = 'TrimRequiredFields'; UPDATE ConfigurationAdmin SET DisplayOrder = 60.04 WHERE VariableName = 'UseCronForRegularEvent'; UPDATE ConfigurationAdmin SET DisplayOrder = 60.05 WHERE VariableName = 'UseChangeLog'; UPDATE ConfigurationAdmin SET DisplayOrder = 60.06 WHERE VariableName = 'Backup_Path'; UPDATE ConfigurationAdmin SET DisplayOrder = 60.07 WHERE VariableName = 'SystemTagCache'; UPDATE ConfigurationAdmin SET DisplayOrder = 60.08 WHERE VariableName = 'SocketBlockingMode'; UPDATE ConfigurationAdmin SET DisplayOrder = 70.01 WHERE VariableName = 'CSVExportDelimiter'; UPDATE ConfigurationAdmin SET DisplayOrder = 70.02 WHERE VariableName = 'CSVExportEnclosure'; UPDATE ConfigurationAdmin SET DisplayOrder = 70.03 WHERE VariableName = 'CSVExportSeparator'; UPDATE ConfigurationAdmin SET DisplayOrder = 70.04 WHERE VariableName = 'CSVExportEncoding'; UPDATE Phrase SET Phrase = 'la_section_SettingsWebsite' WHERE Phrase = 'la_Text_Website'; UPDATE Phrase SET Phrase = 'la_section_SettingsMailling' WHERE Phrase = 'la_Text_smtp_server'; UPDATE Phrase SET Phrase = 'la_section_SettingsCSVExport' WHERE Phrase = 'la_Text_CSV_Export'; DELETE FROM Phrase WHERE Phrase IN ( 'la_Text_BackupPath', 'la_config_AllowManualFilenames', 'la_fld_cat_MenuLink', 'la_fld_UseCategoryTitle', 'la_In-Edit', 'la_ItemTab_Pages', 'la_Text_Pages', 'la_title_Pages', 'la_title_Page_Categories', 'lu_Pages', 'lu_page_HtmlTitle', 'lu_page_OnPageTitle', 'la_tab_AllPages', 'la_title_AllPages', 'la_title_ContentManagement', 'la_title_ContentManagment', 'lu_ViewSubPages', 'la_CMS_FormSubmitted' ); DELETE FROM Phrase WHERE (Phrase LIKE 'la_Description_In-Edit%') OR (Phrase LIKE 'la_Pages_PerPage%') OR (Phrase LIKE 'lu_PermName_Page.%'); UPDATE ConfigurationValues SET VariableValue = 1, ModuleOwner = 'In-Portal:Users', Section = 'in-portal:configure_users' WHERE VariableName = 'RememberLastAdminTemplate'; UPDATE ConfigurationValues SET ModuleOwner = 'In-Portal:Users', Section = 'in-portal:configure_users' WHERE VariableName IN ('AdvancedUserManagement', 'DefaultSettingsUserId'); INSERT INTO ConfigurationAdmin VALUES ('Search_MinKeyword_Length', 'la_Text_General', 'la_config_Search_MinKeyword_Length', 'text', NULL, NULL, 10.19, 0, 0); UPDATE ConfigurationValues SET Section = 'in-portal:configure_categories' WHERE VariableName = 'Search_MinKeyword_Length'; UPDATE ConfigurationAdmin SET ValueList = '=+,SELECT DestName AS OptionName, DestId AS OptionValue FROM StdDestinations WHERE COALESCE(DestParentId, 0) = 0 ORDER BY OptionName' WHERE VariableName = 'User_Default_Registration_Country'; UPDATE ConfigurationValues SET ModuleOwner = 'In-Portal', Section = 'in-portal:configure_advanced' WHERE VariableName IN ( 'Site_Path', 'SiteNameSubTitle', 'CookieSessions', 'SessionCookieName', 'SessionTimeout', 'SessionReferrerCheck', 'SystemTagCache', 'SocketBlockingMode', 'SSL_URL', 'AdminSSL_URL', 'Require_SSL', 'Force_HTTP_When_SSL_Not_Required', 'UseModRewrite', 'UseModRewriteWithSSL', 'UseJSRedirect', 'UseCronForRegularEvent', 'ErrorTemplate', 'NoPermissionTemplate', 'UseOutputCompression', 'OutputCompressionLevel', 'UseToolbarLabels', 'UseSmallHeader', 'UseColumnFreezer', 'TrimRequiredFields', 'UsePageHitCounter', 'UseChangeLog', 'AutoRefreshIntervals', 'KeepSessionOnBrowserClose', 'ForceImageMagickResize', 'CheckStopWords', 'ResizableFrames', 'Config_Server_Time', 'Config_Site_Time', 'Smtp_Server', 'Smtp_Port', 'Smtp_Authenticate', 'Smtp_User', 'Smtp_Pass', 'Smtp_DefaultHeaders', 'MailFunctionHeaderSeparator', 'MailingListQueuePerStep', 'MailingListSendPerStep', 'Backup_Path', 'CSVExportDelimiter', 'CSVExportEnclosure', 'CSVExportSeparator', 'CSVExportEncoding' ); DELETE FROM ConfigurationValues WHERE VariableName IN ( 'Columns_Category', 'Perpage_Archive', 'debug', 'Perpage_User', 'Perpage_LangEmail', 'Default_FromAddr', 'email_replyto', 'email_footer', 'Default_Theme', 'Default_Language', 'User_SortField', 'User_SortOrder', 'Suggest_MinInterval', 'SubCat_ListCount', 'Timeout_Rating', 'Perpage_Relations', 'Group_SortField', 'Group_SortOrder', 'Default_FromName', 'Relation_LV_Sortfield', 'ampm_time', 'Perpage_Template', 'Perpage_Phrase', 'Perpage_Sessionlist', 'Perpage_Items', 'GuestSessions', 'Perpage_Email', 'LinksValidation_LV_Sortfield', 'CustomConfig_LV_Sortfield', 'Event_LV_SortField', 'Theme_LV_SortField', 'Template_LV_SortField', 'Lang_LV_SortField', 'Phrase_LV_SortField', 'LangEmail_LV_SortField', 'CustomData_LV_SortField', 'Summary_SortField', 'Session_SortField', 'SearchLog_SortField', 'Perpage_StatItem', 'Perpage_Groups', 'Perpage_Event', 'Perpage_BanRules', 'Perpage_SearchLog', 'Perpage_LV_lang', 'Perpage_LV_Themes', 'Perpage_LV_Catlist', 'Perpage_Reviews', 'Perpage_Modules', 'Perpage_Grouplist', 'Perpage_Images', 'EmailsL_SortField', 'Perpage_EmailsL', 'Perpage_CustomData', 'Perpage_Review', 'SearchRel_DefaultIncrease', 'SearchRel_DefaultKeyword', 'SearchRel_DefaultPop', 'SearchRel_DefaultRating', 'Category_Highlight_OpenTag', 'Category_Highlight_CloseTag', 'DomainSelect', 'MetaKeywords', 'MetaDescription', 'Config_Name', 'Config_Company', 'Config_Reg_Number', 'Config_Website_Name', 'Config_Web_Address', 'Smtp_SendHTML', 'ProjCMSAllowManualFilenames' ); DELETE FROM ConfigurationAdmin WHERE VariableName IN ('Domain_Detect', 'Server_Name', 'ProjCMSAllowManualFilenames'); DROP TABLE SuggestMail; ALTER TABLE ThemeFiles ADD FileMetaInfo TEXT NULL; UPDATE SearchConfig SET SimpleSearch = 0 WHERE FieldType NOT IN ('text', 'range') AND SimpleSearch = 1; DELETE FROM PersistantSessionData WHERE VariableName IN ('c_columns_.', 'c.showall_columns_.', 'emailevents_columns_.', 'emailmessages_columns_.'); INSERT INTO ConfigurationAdmin VALUES ('DebugOnlyFormConfigurator', 'la_section_SettingsAdmin', 'la_config_DebugOnlyFormConfigurator', 'checkbox', '', '', 40.09, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'DebugOnlyFormConfigurator', '0', 'In-Portal', 'in-portal:configure_advanced'); CREATE TABLE Semaphores ( SemaphoreId int(11) NOT NULL auto_increment, SessionKey int(10) unsigned NOT NULL, Timestamp int(10) unsigned NOT NULL, MainPrefix varchar(255) NOT NULL, PRIMARY KEY (SemaphoreId), KEY SessionKey (SessionKey), KEY Timestamp (Timestamp), KEY MainPrefix (MainPrefix) ); ALTER TABLE Language ADD IconDisabledURL VARCHAR(255) NULL DEFAULT NULL AFTER IconURL; UPDATE Phrase SET Translation = REPLACE(Translation, 'category', 'section') WHERE (Phrase IN ( 'la_confirm_maintenance', 'la_error_move_subcategory', 'la_error_RootCategoriesDelete', 'la_error_unknown_category', 'la_fld_IsBaseCategory', 'la_nextcategory', 'la_prevcategory', 'la_prompt_max_import_category_levels', 'la_prompt_root_name', 'la_SeparatedCategoryPath', 'la_title_category_select' ) OR Phrase LIKE 'la_Description_%') AND (PhraseType = 1); UPDATE Phrase SET Translation = REPLACE(Translation, 'Category', 'Section') WHERE PhraseType = 1; UPDATE Phrase SET Translation = REPLACE(Translation, 'categories', 'sections') WHERE (Phrase IN ( 'la_category_perpage_prompt', 'la_category_showpick_prompt', 'la_category_sortfield_prompt', 'la_Description_in-portal:advanced_view', 'la_Description_in-portal:browse', 'la_Description_in-portal:site', 'la_error_copy_subcategory', 'la_Msg_PropagateCategoryStatus', 'la_Text_DataType_1' )) AND (PhraseType = 1); UPDATE Phrase SET Translation = REPLACE(Translation, 'Categories', 'Sections') WHERE PhraseType = 1; UPDATE Phrase SET Translation = REPLACE(Translation, 'Page', 'Section') WHERE (Phrase IN ('la_col_PageTitle', 'la_col_System', 'la_fld_IsIndex', 'la_fld_PageTitle', 'la_section_Page')) AND (PhraseType = 1); DELETE FROM Phrase WHERE Phrase IN ('la_title_Adding_Page', 'la_title_Editing_Page', 'la_title_New_Page', 'la_fld_PageId'); INSERT INTO ConfigurationAdmin VALUES ('UseModalWindows', 'la_section_SettingsAdmin', 'la_config_UseModalWindows', 'checkbox', '', '', 40.10, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseModalWindows', '1', 'In-Portal', 'in-portal:configure_advanced'); UPDATE Language SET UserDocsUrl = 'http://docs.in-portal.org/eng/index.php'; DELETE FROM Modules WHERE Name = 'Proj-Base'; DELETE FROM Phrase WHERE Phrase IN ('la_fld_ImageId', 'la_fld_RelationshipId', 'la_fld_ReviewId', 'la_prompt_CensorhipId', 'my_account_title', 'Next Theme', 'Previous Theme', 'test 1', 'la_article_reviewed', 'la_configerror_review', 'la_link_reviewed', 'la_Prompt_ReviewedBy', 'la_prompt_ReviewId', 'la_prompt_ReviewText', 'la_reviewer', 'la_review_added', 'la_review_alreadyreviewed', 'la_review_error', 'la_tab_Editing_Review', 'la_tab_Review', 'la_ToolTip_New_Review', 'la_topic_reviewed', 'lu_add_review', 'lu_article_reviews', 'lu_ferror_review_duplicate', 'lu_link_addreview_confirm_pending_text', 'lu_link_reviews', 'lu_link_review_confirm', 'lu_link_review_confirm_pending', 'lu_link_addreview_confirm_text', 'lu_news_addreview_confirm_text', 'lu_news_addreview_confirm__pending_text', 'lu_news_review_confirm', 'lu_news_review_confirm_pending', 'lu_prompt_review', 'lu_reviews_updated', 'lu_review_access_denied', 'lu_review_article', 'lu_review_link', 'lu_review_news', 'lu_review_this_article', 'lu_fld_Review', 'lu_product_reviews', 'lu_ReviewProduct', ' lu_resetpw_confirm_text', 'lu_resetpw_confirm_text'); UPDATE Modules SET Version = '5.0.0', Loaded = 1 WHERE Name = 'In-Portal'; # ===== v 5.0.1 ===== UPDATE ConfigurationAdmin SET ValueList = '1=la_opt_UserInstantRegistration,2=la_opt_UserNotAllowedRegistration,3=la_opt_UserUponApprovalRegistration,4=la_opt_UserEmailActivation' WHERE VariableName = 'User_Allow_New'; UPDATE ConfigurationValues SET VariableValue = '1' WHERE VariableName = 'ResizableFrames'; UPDATE Phrase SET Translation = REPLACE(Translation, 'Page', 'Section') WHERE (Phrase IN ('la_col_PageTitle', 'la_col_System', 'la_fld_IsIndex', 'la_fld_PageTitle', 'la_section_Page')) AND (PhraseType = 1); DELETE FROM Phrase WHERE Phrase IN ('la_Tab', 'la_Colon', 'la_Semicolon', 'la_Space', 'la_Colon', 'la_User_Instant', 'la_User_Not_Allowed', 'la_User_Upon_Approval', 'lu_title_PrivacyPolicy'); UPDATE ConfigurationAdmin SET ValueList = '0=la_opt_Tab,1=la_opt_Comma,2=la_opt_Semicolon,3=la_opt_Space,4=la_opt_Colon' WHERE VariableName = 'CSVExportDelimiter'; UPDATE ConfigurationAdmin SET ValueList = '0=lu_opt_QueryString,1=lu_opt_Cookies,2=lu_opt_AutoDetect' WHERE VariableName = 'CookieSessions'; UPDATE ConfigurationAdmin SET ValueList = 'Name=la_opt_Title,Description=la_opt_Description,CreatedOn=la_opt_CreatedOn,EditorsPick=la_opt_EditorsPick,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 1) AND (IsSystem = 0)' WHERE VariableName = 'Category_Sortfield'; UPDATE ConfigurationAdmin SET ValueList = 'Name=la_opt_Title,Description=la_opt_Description,CreatedOn=la_opt_CreatedOn,EditorsPick=la_opt_EditorsPick,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 1) AND (IsSystem = 0)' WHERE VariableName = 'Category_Sortfield2'; UPDATE Category SET Template = '#inherit#' WHERE COALESCE(Template, '') = ''; ALTER TABLE Category CHANGE Template Template VARCHAR(255) NOT NULL DEFAULT '#inherit#'; UPDATE Phrase SET Phrase = 'la_config_DefaultDesignTemplate' WHERE Phrase = 'la_prompt_DefaultDesignTemplate'; UPDATE ConfigurationAdmin SET heading = 'la_section_SettingsWebsite', prompt = 'la_config_DefaultDesignTemplate', DisplayOrder = 10.06 WHERE VariableName = 'cms_DefaultDesign'; UPDATE ConfigurationValues SET Section = 'in-portal:configure_advanced' WHERE VariableName = 'cms_DefaultDesign'; UPDATE ConfigurationAdmin SET DisplayOrder = DisplayOrder + 0.01 WHERE VariableName IN ('ErrorTemplate', 'NoPermissionTemplate'); UPDATE ConfigurationAdmin SET DisplayOrder = 10.15 WHERE VariableName = 'Search_MinKeyword_Length'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.01 WHERE VariableName = 'Site_Name'; UPDATE ConfigurationAdmin SET DisplayOrder = 20.01 WHERE VariableName = 'FirstDayOfWeek'; UPDATE ConfigurationAdmin SET DisplayOrder = 30.01 WHERE VariableName = 'Smtp_AdminMailFrom'; UPDATE ConfigurationAdmin SET heading = 'la_Text_Date_Time_Settings', DisplayOrder = DisplayOrder + 9.98 WHERE VariableName IN ('Config_Server_Time', 'Config_Site_Time'); UPDATE ConfigurationValues SET Section = 'in-portal:configure_general' WHERE VariableName IN ('Config_Server_Time', 'Config_Site_Time'); UPDATE ConfigurationAdmin SET DisplayOrder = DisplayOrder - 0.02 WHERE VariableName IN ('cms_DefaultDesign', 'ErrorTemplate', 'NoPermissionTemplate', 'UsePageHitCounter', 'ForceImageMagickResize', 'CheckStopWords'); UPDATE ConfigurationAdmin SET DisplayOrder = 40.01 WHERE VariableName = 'SessionTimeout'; UPDATE ConfigurationValues SET Section = 'in-portal:configure_general' WHERE VariableName = 'SessionTimeout'; UPDATE ConfigurationAdmin SET DisplayOrder = DisplayOrder - 0.01 WHERE VariableName IN ('KeepSessionOnBrowserClose', 'SessionReferrerCheck', 'UseJSRedirect'); ALTER TABLE Events ADD FrontEndOnly TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER Enabled, ADD INDEX (FrontEndOnly); UPDATE Events SET FrontEndOnly = 1 WHERE Enabled = 2; UPDATE Events SET Enabled = 1 WHERE Enabled = 2; ALTER TABLE Events CHANGE FromUserId FromUserId INT(11) NULL DEFAULT NULL; UPDATE Events SET FromUserId = NULL WHERE FromUserId = 0; DELETE FROM ConfigurationAdmin WHERE VariableName = 'SiteNameSubTitle'; DELETE FROM ConfigurationValues WHERE VariableName = 'SiteNameSubTitle'; UPDATE ConfigurationAdmin SET DisplayOrder = DisplayOrder - 0.01 WHERE VariableName IN ('UseModRewrite', 'cms_DefaultDesign', 'ErrorTemplate' 'NoPermissionTemplate', 'UsePageHitCounter', 'ForceImageMagickResize', 'CheckStopWords'); ALTER TABLE ConfigurationAdmin CHANGE validation Validation TEXT NULL DEFAULT NULL; UPDATE ConfigurationAdmin SET Validation = 'a:3:{s:4:"type";s:3:"int";s:13:"min_value_inc";i:1;s:8:"required";i:1;}' WHERE VariableName = 'SessionTimeout'; INSERT INTO ConfigurationAdmin VALUES ('AdminConsoleInterface', 'la_section_SettingsAdmin', 'la_config_AdminConsoleInterface', 'select', '', 'simple=+simple,advanced=+advanced,custom=+custom', 50.01, 0, 1); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AdminConsoleInterface', 'simple', 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationAdmin VALUES ('AllowAdminConsoleInterfaceChange', 'la_section_SettingsAdmin', 'la_config_AllowAdminConsoleInterfaceChange', 'checkbox', NULL , NULL , 40.01, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AllowAdminConsoleInterfaceChange', '1', 'In-Portal', 'in-portal:configure_advanced'); UPDATE ConfigurationAdmin SET DisplayOrder = DisplayOrder + 0.01 WHERE VariableName IN ('UseToolbarLabels', 'UseSmallHeader', 'UseColumnFreezer', 'UsePopups', 'UseDoubleSorting', 'MenuFrameWidth', 'ResizableFrames', 'AutoRefreshIntervals', 'DebugOnlyFormConfigurator', 'UseModalWindows'); INSERT INTO ConfigurationAdmin VALUES ('UseTemplateCompression', 'la_section_SettingsSystem', 'la_config_UseTemplateCompression', 'checkbox', '', '', 60.03, 0, 1); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseTemplateCompression', '0', 'In-Portal', 'in-portal:configure_advanced'); UPDATE ConfigurationAdmin SET DisplayOrder = DisplayOrder + 0.01 WHERE VariableName IN ('TrimRequiredFields', 'UseCronForRegularEvent', 'UseChangeLog', 'Backup_Path', 'SystemTagCache', 'SocketBlockingMode'); DELETE FROM ConfigurationAdmin WHERE VariableName = 'UseModalWindows'; DELETE FROM ConfigurationValues WHERE VariableName = 'UseModalWindows'; DELETE FROM Phrase WHERE Phrase = 'la_config_UseModalWindows'; UPDATE ConfigurationAdmin SET element_type = 'select', ValueList = '0=la_opt_SameWindow,1=la_opt_PopupWindow,2=la_opt_ModalWindow' WHERE VariableName = 'UsePopups'; UPDATE Phrase SET Translation = 'Editing Window Style' WHERE Phrase = 'la_config_UsePopups'; INSERT INTO ConfigurationAdmin VALUES ('UseVisitorTracking', 'la_section_SettingsWebsite', 'la_config_UseVisitorTracking', 'checkbox', '', '', 10.09, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseVisitorTracking', '0', 'In-Portal', 'in-portal:configure_advanced'); DELETE FROM ConfigurationAdmin WHERE VariableName = 'SessionReferrerCheck'; DELETE FROM ConfigurationValues WHERE VariableName = 'SessionReferrerCheck'; DELETE FROM Phrase WHERE Phrase = 'la_promt_ReferrerCheck'; INSERT INTO ConfigurationAdmin VALUES ('SessionBrowserSignatureCheck', 'la_section_SettingsSession', 'la_config_SessionBrowserSignatureCheck', 'checkbox', NULL, NULL, 20.04, 0, 1); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SessionBrowserSignatureCheck', '0', 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO ConfigurationAdmin VALUES ('SessionIPAddressCheck', 'la_section_SettingsSession', 'la_config_SessionIPAddressCheck', 'checkbox', NULL, NULL, 20.05, 0, 1); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SessionIPAddressCheck', '0', 'In-Portal', 'in-portal:configure_advanced'); UPDATE ConfigurationAdmin SET DisplayOrder = DisplayOrder + 0.01 WHERE VariableName = 'UseJSRedirect'; ALTER TABLE UserSession DROP CurrentTempKey, DROP PrevTempKey, ADD BrowserSignature VARCHAR(32) NOT NULL, ADD INDEX (BrowserSignature); UPDATE ConfigurationAdmin SET DisplayOrder = DisplayOrder + 0.01 WHERE heading = 'la_section_SettingsAdmin' AND DisplayOrder > 40 AND DisplayOrder < 50; UPDATE ConfigurationAdmin SET heading = 'la_section_SettingsAdmin', DisplayOrder = 40.01 WHERE VariableName = 'RootPass'; UPDATE ConfigurationValues SET ModuleOwner = 'In-Portal', Section = 'in-portal:configure_advanced' WHERE VariableName = 'RootPass'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.12 WHERE VariableName = 'User_Default_Registration_Country'; UPDATE ConfigurationAdmin SET heading = 'la_section_SettingsAdmin', DisplayOrder = 40.12 WHERE VariableName = 'RememberLastAdminTemplate'; UPDATE ConfigurationValues SET ModuleOwner = 'In-Portal', Section = 'in-portal:configure_advanced' WHERE VariableName = 'RememberLastAdminTemplate'; UPDATE ConfigurationAdmin SET DisplayOrder = 10.14 WHERE VariableName = 'DefaultSettingsUserId'; INSERT INTO ConfigurationAdmin VALUES ('UseHTTPAuth', 'la_section_SettingsAdmin', 'la_config_UseHTTPAuth', 'checkbox', '', '', 40.13, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseHTTPAuth', '0', 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO ConfigurationAdmin VALUES ('HTTPAuthUsername', 'la_section_SettingsAdmin', 'la_config_HTTPAuthUsername', 'text', '', '', 40.14, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'HTTPAuthUsername', '', 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO ConfigurationAdmin VALUES ('HTTPAuthPassword', 'la_section_SettingsAdmin', 'la_config_HTTPAuthPassword', 'password', NULL, NULL, 40.15, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'HTTPAuthPassword', '', 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO ConfigurationAdmin VALUES ('HTTPAuthBypassIPs', 'la_section_SettingsAdmin', 'la_config_HTTPAuthBypassIPs', 'text', '', '', 40.15, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'HTTPAuthBypassIPs', '', 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:service.edit', 11, 1, 1, 0); UPDATE Phrase SET Phrase = 'la_col_Rating' WHERE Phrase = 'la_col_rating'; UPDATE Phrase SET Phrase = 'la_text_Review' WHERE Phrase = 'la_text_review'; UPDATE Phrase SET Phrase = 'la_title_Reviews' WHERE Phrase = 'la_title_reviews'; UPDATE Phrase SET Phrase = 'la_ToolTip_cancel' WHERE Phrase = 'la_tooltip_cancel'; ALTER TABLE Phrase ADD PhraseKey VARCHAR(255) NOT NULL AFTER Phrase, ADD INDEX (PhraseKey); UPDATE Phrase SET PhraseKey = UPPER(Phrase); UPDATE Modules SET Loaded = 1 WHERE `Name` = 'In-Portal'; # ===== v 5.0.2-B1 ===== ALTER TABLE PortalGroup DROP ResourceId; ALTER TABLE Category DROP l1_Translated, DROP l2_Translated, DROP l3_Translated, DROP l4_Translated, DROP l5_Translated; ALTER TABLE PageContent DROP l1_Translated, DROP l2_Translated, DROP l3_Translated, DROP l4_Translated, DROP l5_Translated; ALTER TABLE Category CHANGE CachedTemplate CachedTemplate varchar(255) NOT NULL DEFAULT '', CHANGE ThemeId ThemeId int(10) unsigned NOT NULL DEFAULT '0'; ALTER TABLE UserSession CHANGE BrowserSignature BrowserSignature varchar(32) NOT NULL DEFAULT ''; ALTER TABLE ChangeLogs CHANGE Changes Changes text NULL, CHANGE OccuredOn OccuredOn INT(11) NULL DEFAULT NULL; ALTER TABLE EmailLog CHANGE EventParams EventParams text NULL; ALTER TABLE FormFields CHANGE DefaultValue DefaultValue text NULL; ALTER TABLE ImportCache CHANGE VarValue VarValue text NULL; ALTER TABLE ImportScripts CHANGE Description Description text NULL; ALTER TABLE PersistantSessionData CHANGE VariableValue VariableValue text NULL; ALTER TABLE Phrase CHANGE `Translation` `Translation` text NULL, CHANGE PhraseKey PhraseKey VARCHAR(255) NOT NULL DEFAULT '', CHANGE LastChanged LastChanged INT(10) UNSIGNED NULL DEFAULT NULL; ALTER TABLE PhraseCache CHANGE PhraseList PhraseList text NULL; ALTER TABLE Stylesheets CHANGE AdvancedCSS AdvancedCSS text NULL, CHANGE LastCompiled LastCompiled INT(10) UNSIGNED NULL DEFAULT NULL; ALTER TABLE StylesheetSelectors CHANGE SelectorData SelectorData text NULL, CHANGE Description Description text NULL, CHANGE AdvancedCSS AdvancedCSS text NULL; ALTER TABLE Category CHANGE `Status` `Status` TINYINT(4) NOT NULL DEFAULT '1', CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL, CHANGE Modified Modified INT(11) NULL DEFAULT NULL; ALTER TABLE Language CHANGE UserDocsUrl UserDocsUrl VARCHAR(255) NOT NULL DEFAULT ''; ALTER TABLE MailingLists CHANGE Subject Subject VARCHAR(255) NOT NULL DEFAULT '', CHANGE EmailsQueued EmailsQueued INT(10) UNSIGNED NOT NULL DEFAULT '0', CHANGE EmailsSent EmailsSent INT(10) UNSIGNED NOT NULL DEFAULT '0', CHANGE EmailsTotal EmailsTotal INT(10) UNSIGNED NOT NULL DEFAULT '0'; ALTER TABLE EmailQueue CHANGE MailingId MailingId INT(10) UNSIGNED NOT NULL DEFAULT '0', CHANGE Queued Queued INT(10) UNSIGNED NULL DEFAULT NULL, CHANGE LastSendRetry LastSendRetry INT(10) UNSIGNED NULL DEFAULT NULL; ALTER TABLE ImportScripts CHANGE `Status` `Status` TINYINT(4) NOT NULL DEFAULT '1'; ALTER TABLE Semaphores CHANGE SessionKey SessionKey INT(10) UNSIGNED NOT NULL DEFAULT '0', CHANGE `Timestamp` `Timestamp` INT(10) UNSIGNED NOT NULL DEFAULT '0', CHANGE MainPrefix MainPrefix VARCHAR(255) NOT NULL DEFAULT ''; ALTER TABLE Skins CHANGE LogoBottom LogoBottom VARCHAR(255) NOT NULL DEFAULT '', CHANGE LogoLogin LogoLogin VARCHAR(255) NOT NULL DEFAULT ''; ALTER TABLE ItemReview CHANGE ReviewText ReviewText LONGTEXT NULL; ALTER TABLE SessionData CHANGE VariableValue VariableValue LONGTEXT NULL; ALTER TABLE PortalUser CHANGE `Status` `Status` TINYINT(4) NOT NULL DEFAULT '1', CHANGE Modified Modified INT(11) NULL DEFAULT NULL; ALTER TABLE ItemFiles CHANGE CreatedOn CreatedOn INT(11) UNSIGNED NULL DEFAULT NULL; ALTER TABLE FormSubmissions CHANGE SubmissionTime SubmissionTime INT(11) NULL DEFAULT NULL; ALTER TABLE SessionLogs CHANGE SessionStart SessionStart INT(11) NULL DEFAULT NULL; ALTER TABLE Visits CHANGE VisitDate VisitDate INT(10) UNSIGNED NULL DEFAULT NULL; # ===== v 5.0.2-B2 ===== ALTER TABLE Theme ADD LanguagePackInstalled TINYINT UNSIGNED NOT NULL DEFAULT '0', ADD TemplateAliases TEXT, ADD INDEX (LanguagePackInstalled); ALTER TABLE ThemeFiles ADD TemplateAlias VARCHAR(255) NOT NULL DEFAULT '' AFTER FilePath, ADD INDEX (TemplateAlias); UPDATE Phrase SET PhraseType = 1 WHERE Phrase IN ('la_ToolTip_MoveUp', 'la_ToolTip_MoveDown', 'la_invalid_state', 'la_Pending', 'la_text_sess_expired', 'la_ToolTip_Export'); DELETE FROM Phrase WHERE Phrase IN ('la_ToolTip_Move_Up', 'la_ToolTip_Move_Down'); UPDATE Phrase SET Phrase = 'lu_btn_SendPassword' WHERE Phrase = 'LU_BTN_SENDPASSWORD'; ALTER TABLE Category DROP IsIndex; DELETE FROM Phrase WHERE Phrase IN ('la_CategoryIndex', 'la_Container', 'la_fld_IsIndex', 'lu_text_Redirecting', 'lu_title_Redirecting', 'lu_zip_code'); ALTER TABLE PortalUser ADD AdminLanguage INT(11) NULL DEFAULT NULL, ADD INDEX (AdminLanguage); # ===== v 5.0.2-RC1 ===== # ===== v 5.0.2 ===== # ===== v 5.0.3-B1 ===== ALTER TABLE PermCache ADD INDEX (ACL); INSERT INTO ConfigurationAdmin VALUES ('cms_DefaultTrackingCode', 'la_section_SettingsWebsite', 'la_config_DefaultTrackingCode', 'textarea', NULL, 'COLS=40 ROWS=5', 10.10, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'cms_DefaultTrackingCode', '', 'In-Portal', 'in-portal:configure_advanced'); UPDATE Phrase SET Module = 'Core' WHERE Phrase IN ('la_fld_Image', 'la_fld_Qty'); # ===== v 5.0.3-B2 ===== UPDATE CustomField SET ValueList = REPLACE(ValueList, '=+||', '') WHERE ElementType = 'radio'; # ===== v 5.0.3-RC1 ===== # ===== v 5.0.3 ===== # ===== v 5.0.4-B1 ===== # ===== v 5.0.4-B2 ===== # ===== v 5.0.4 ===== # ===== v 5.1.0-B1 ===== DROP TABLE EmailMessage; DELETE FROM PersistantSessionData WHERE VariableName = 'emailevents_columns_.'; INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) SELECT 'in-portal:configemail.add' AS Permission, GroupId, PermissionValue, Type, CatId FROM <%TABLE_PREFIX%>Permissions WHERE Permission = 'in-portal:configemail.edit'; INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) SELECT 'in-portal:configemail.delete' AS Permission, GroupId, PermissionValue, Type, CatId FROM <%TABLE_PREFIX%>Permissions WHERE Permission = 'in-portal:configemail.edit'; ALTER TABLE Events ADD l1_Description text; UPDATE Events e SET e.l1_Description = ( SELECT p.l<%PRIMARY_LANGUAGE%>_Translation FROM <%TABLE_PREFIX%>Phrase p WHERE p.Phrase = e.Description ); UPDATE Events SET Description = l1_Description; ALTER TABLE Events DROP l1_Description, CHANGE Description Description TEXT NULL; DELETE FROM Phrase WHERE Phrase LIKE 'la_event_%'; DELETE FROM PersistantSessionData WHERE VariableName = 'phrases_columns_.'; UPDATE Category SET FormId = NULL WHERE FormId = 0; INSERT INTO ConfigurationAdmin VALUES ('MemcacheServers', 'la_section_SettingsCaching', 'la_config_MemcacheServers', 'text', '', '', 80.02, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'MemcacheServers', 'localhost:11211', 'In-Portal', 'in-portal:configure_advanced'); ALTER TABLE Category ADD EnablePageCache TINYINT NOT NULL DEFAULT '0', ADD OverridePageCacheKey TINYINT NOT NULL DEFAULT '0', ADD PageCacheKey VARCHAR(255) NOT NULL DEFAULT '', ADD PageExpiration INT NULL DEFAULT NULL , ADD INDEX (EnablePageCache), ADD INDEX (OverridePageCacheKey), ADD INDEX (PageExpiration); DELETE FROM Cache WHERE VarName LIKE 'mod_rw_%'; CREATE TABLE CachedUrls ( UrlId int(11) NOT NULL AUTO_INCREMENT, Url varchar(255) NOT NULL DEFAULT '', DomainId int(11) NOT NULL DEFAULT '0', `Hash` int(11) NOT NULL DEFAULT '0', Prefixes varchar(255) NOT NULL DEFAULT '', ParsedVars text NOT NULL, Cached int(10) unsigned DEFAULT NULL, LifeTime int(11) NOT NULL DEFAULT '-1', PRIMARY KEY (UrlId), KEY Url (Url), KEY `Hash` (`Hash`), KEY Prefixes (Prefixes), KEY Cached (Cached), KEY LifeTime (LifeTime), KEY DomainId (DomainId) ); INSERT INTO ConfigurationAdmin VALUES ('CacheHandler', 'la_section_SettingsCaching', 'la_config_CacheHandler', 'select', NULL, 'Fake=la_None||Memcache=+Memcached||Apc=+Alternative PHP Cache||XCache=+XCache', 80.01, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CacheHandler', 'Fake', 'In-Portal', 'in-portal:configure_advanced'); ALTER TABLE ConfigurationValues ADD Heading varchar(255) NOT NULL DEFAULT '', ADD Prompt varchar(255) NOT NULL DEFAULT '', ADD ElementType varchar(255) NOT NULL DEFAULT '', ADD Validation text, ADD ValueList text, ADD DisplayOrder double NOT NULL DEFAULT '0', ADD GroupDisplayOrder double NOT NULL DEFAULT '0', ADD Install int(11) NOT NULL DEFAULT '1', ADD INDEX (DisplayOrder), ADD INDEX (GroupDisplayOrder), ADD INDEX (Install); UPDATE ConfigurationValues cv SET cv.Heading = (SELECT ca1.heading FROM <%TABLE_PREFIX%>ConfigurationAdmin ca1 WHERE ca1.VariableName = cv.VariableName), cv.Prompt = (SELECT ca2.prompt FROM <%TABLE_PREFIX%>ConfigurationAdmin ca2 WHERE ca2.VariableName = cv.VariableName), cv.ElementType = (SELECT ca3.element_type FROM <%TABLE_PREFIX%>ConfigurationAdmin ca3 WHERE ca3.VariableName = cv.VariableName), cv.Validation = (SELECT ca4.Validation FROM <%TABLE_PREFIX%>ConfigurationAdmin ca4 WHERE ca4.VariableName = cv.VariableName), cv.ValueList = (SELECT ca5.ValueList FROM <%TABLE_PREFIX%>ConfigurationAdmin ca5 WHERE ca5.VariableName = cv.VariableName), cv.DisplayOrder = (SELECT ca6.DisplayOrder FROM <%TABLE_PREFIX%>ConfigurationAdmin ca6 WHERE ca6.VariableName = cv.VariableName), cv.GroupDisplayOrder = (SELECT ca7.GroupDisplayOrder FROM <%TABLE_PREFIX%>ConfigurationAdmin ca7 WHERE ca7.VariableName = cv.VariableName), cv.`Install` = (SELECT ca8.`Install` FROM <%TABLE_PREFIX%>ConfigurationAdmin ca8 WHERE ca8.VariableName = cv.VariableName); DROP TABLE ConfigurationAdmin; UPDATE ConfigurationValues SET ValueList = '=+||SELECT l%3$s_Name AS OptionName, CountryStateId AS OptionValue FROM CountryStates WHERE Type = 1 ORDER BY OptionName' WHERE ValueList = '=+||SELECT DestName AS OptionName, DestId AS OptionValue FROM StdDestinations WHERE COALESCE(DestParentId, 0) = 0 ORDER BY OptionName'; ALTER TABLE Forms ADD RequireLogin TINYINT NOT NULL DEFAULT '0', ADD INDEX (RequireLogin), ADD UseSecurityImage TINYINT NOT NULL DEFAULT '0', ADD INDEX (UseSecurityImage), ADD EnableEmailCommunication TINYINT NOT NULL DEFAULT '0', ADD INDEX (EnableEmailCommunication), ADD ReplyFromName VARCHAR(255) NOT NULL DEFAULT '', ADD ReplyFromEmail VARCHAR(255) NOT NULL DEFAULT '', ADD ReplyCc VARCHAR(255) NOT NULL DEFAULT '', ADD ReplyBcc VARCHAR(255) NOT NULL DEFAULT '', ADD ReplyMessageSignature TEXT, ADD ReplyServer VARCHAR(255) NOT NULL DEFAULT '', ADD ReplyPort INT(10) NOT NULL DEFAULT '110', ADD ReplyUsername VARCHAR(255) NOT NULL DEFAULT '', ADD ReplyPassword VARCHAR(255) NOT NULL DEFAULT '', ADD BounceEmail VARCHAR(255) NOT NULL DEFAULT '', ADD BounceServer VARCHAR(255) NOT NULL DEFAULT '', ADD BouncePort INT(10) NOT NULL DEFAULT '110', ADD BounceUsername VARCHAR(255) NOT NULL DEFAULT '', ADD BouncePassword VARCHAR(255) NOT NULL DEFAULT ''; ALTER TABLE FormFields ADD Visibility TINYINT NOT NULL DEFAULT '1', ADD INDEX (Visibility), ADD EmailCommunicationRole TINYINT NOT NULL DEFAULT '0', ADD INDEX (EmailCommunicationRole); ALTER TABLE FormSubmissions ADD IPAddress VARCHAR(15) NOT NULL DEFAULT '' AFTER SubmissionTime, ADD ReferrerURL VARCHAR(255) NOT NULL DEFAULT '' AFTER IPAddress, ADD LogStatus TINYINT UNSIGNED NOT NULL DEFAULT '2' AFTER ReferrerURL, ADD LastUpdatedOn INT UNSIGNED NULL AFTER LogStatus, ADD Notes TEXT NULL AFTER LastUpdatedOn, ADD INDEX (LogStatus), ADD INDEX (LastUpdatedOn); CREATE TABLE SubmissionLog ( SubmissionLogId int(11) NOT NULL AUTO_INCREMENT, FormSubmissionId int(10) unsigned NOT NULL, FromEmail varchar(255) NOT NULL DEFAULT '', ToEmail varchar(255) NOT NULL DEFAULT '', Cc text, Bcc text, `Subject` varchar(255) NOT NULL DEFAULT '', Message text, Attachment text, ReplyStatus tinyint(3) unsigned NOT NULL DEFAULT '0', SentStatus tinyint(3) unsigned NOT NULL DEFAULT '0', SentOn int(10) unsigned DEFAULT NULL, RepliedOn int(10) unsigned DEFAULT NULL, VerifyCode varchar(32) NOT NULL DEFAULT '', DraftId int(10) unsigned NOT NULL DEFAULT '0', MessageId varchar(255) NOT NULL DEFAULT '', BounceInfo text, BounceDate int(11) DEFAULT NULL, PRIMARY KEY (SubmissionLogId), KEY FormSubmissionId (FormSubmissionId), KEY ReplyStatus (ReplyStatus), KEY SentStatus (SentStatus), KEY SentOn (SentOn), KEY RepliedOn (RepliedOn), KEY VerifyCode (VerifyCode), KEY DraftId (DraftId), KEY BounceDate (BounceDate), KEY MessageId (MessageId) ); CREATE TABLE Drafts ( DraftId int(11) NOT NULL AUTO_INCREMENT, FormSubmissionId int(10) unsigned NOT NULL DEFAULT '0', CreatedOn int(10) unsigned DEFAULT NULL, CreatedById int(11) NOT NULL, Message text, PRIMARY KEY (DraftId), KEY FormSubmissionId (FormSubmissionId), KEY CreatedOn (CreatedOn), KEY CreatedById (CreatedById) ); INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'FORM.SUBMISSION.REPLY.TO.USER', NULL, 1, 0, NULL, 'Core:Category', 'Admin Reply to User Form Submission', 1); INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'FORM.SUBMISSION.REPLY.FROM.USER', NULL, 1, 0, NULL, 'Core:Category', 'User Replied to It\'s Form Submission', 1); INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, FromUserId, Module, Description, Type) VALUES(DEFAULT, 'FORM.SUBMISSION.REPLY.FROM.USER.BOUNCED', NULL, 1, 0, NULL, 'Core:Category', 'Form Submission Admin Reply Delivery Failure', 1); ALTER TABLE ConfigurationValues ADD HintLabel VARCHAR(255) NULL DEFAULT NULL, ADD INDEX (HintLabel); UPDATE ConfigurationValues SET HintLabel = 'la_hint_MemcacheServers' WHERE VariableName = 'MemcacheServers'; INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ModRewriteUrlEnding', '.html', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ModRewriteUrlEnding', 'select', '', '=+||/=+/||.html=+.html', 10.021, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ForceModRewriteUrlEnding', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ForceModRewriteUrlEnding', 'checkbox', '', NULL, 10.022, 0, 0, 'la_hint_ForceModRewriteUrlEnding'); UPDATE Phrase SET l<%PRIMARY_LANGUAGE%>_Translation = 'Enable SEO-friendly URLs mode (MOD-REWRITE)' WHERE Phrase = 'la_config_use_modrewrite' AND l<%PRIMARY_LANGUAGE%>_Translation = 'Use MOD REWRITE'; INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseContentLanguageNegotiation', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_UseContentLanguageNegotiation', 'checkbox', '', '', 10.023, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'SessionCookieDomains', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSession', 'la_config_SessionCookieDomains', 'textarea', '', 'rows="5" cols="40"', 20.021, 0, 0, NULL); CREATE TABLE SiteDomains ( DomainId int(11) NOT NULL AUTO_INCREMENT, DomainName varchar(255) NOT NULL DEFAULT '', DomainNameUsesRegExp tinyint(4) NOT NULL DEFAULT '0', SSLUrl varchar(255) NOT NULL DEFAULT '', SSLUrlUsesRegExp tinyint(4) NOT NULL DEFAULT '0', AdminEmail varchar(255) NOT NULL DEFAULT '', Country varchar(3) NOT NULL DEFAULT '', PrimaryLanguageId int(11) NOT NULL DEFAULT '0', Languages varchar(255) NOT NULL DEFAULT '', PrimaryThemeId int(11) NOT NULL DEFAULT '0', Themes varchar(255) NOT NULL DEFAULT '', DomainIPRange text, ExternalUrl varchar(255) NOT NULL DEFAULT '', RedirectOnIPMatch tinyint(4) NOT NULL DEFAULT '0', Priority int(11) NOT NULL DEFAULT '0', PRIMARY KEY (DomainId), KEY DomainName (DomainName), KEY DomainNameUsesRegExp (DomainNameUsesRegExp), KEY SSLUrl (SSLUrl), KEY SSLUrlUsesRegExp (SSLUrlUsesRegExp), KEY AdminEmail (AdminEmail), KEY Country (Country), KEY PrimaryLanguageId (PrimaryLanguageId), KEY Languages (Languages), KEY PrimaryThemeId (PrimaryThemeId), KEY Themes (Themes), KEY ExternalUrl (ExternalUrl), KEY RedirectOnIPMatch (RedirectOnIPMatch), KEY Priority (Priority) ); DELETE FROM Phrase WHERE Phrase = 'la_config_time_server'; DELETE FROM ConfigurationValues WHERE VariableName = 'Config_Server_Time'; UPDATE ConfigurationValues SET ValueList = NULL, DisplayOrder = 20.02 WHERE VariableName = 'Config_Site_Time'; UPDATE ConfigurationValues SET VariableValue = '' WHERE VariableName = 'Config_Site_Time' AND VariableValue = 14; UPDATE Events SET AllowChangingSender = 1, AllowChangingRecipient = 1; UPDATE Events SET Module = 'Core' WHERE Module LIKE 'Core:%'; DELETE FROM Permissions WHERE Permission LIKE 'in-portal:configuration_email%'; DELETE FROM Permissions WHERE Permission LIKE 'in-portal:user_email%'; DELETE FROM Phrase WHERE Phrase IN ('la_fld_FromToUser', 'la_col_FromToUser'); # ===== v 5.1.0-B2 ===== # ===== v 5.1.0-RC1 ===== UPDATE Phrase SET Module = 'Core' WHERE Phrase = 'la_fld_Group'; UPDATE PermissionConfig SET Description = REPLACE(Description, 'lu_PermName_', 'la_PermName_'), ErrorMessage = REPLACE(ErrorMessage, 'lu_PermName_', 'la_PermName_'); UPDATE Phrase SET Phrase = REPLACE(Phrase, 'lu_PermName_', 'la_PermName_'), PhraseKey = REPLACE(PhraseKey, 'LU_PERMNAME_', 'LA_PERMNAME_'), PhraseType = 1 WHERE PhraseKey LIKE 'LU_PERMNAME_%'; UPDATE Phrase SET Phrase = 'la_no_permissions', PhraseKey = 'LA_NO_PERMISSIONS', PhraseType = 1 WHERE PhraseKey = 'LU_NO_PERMISSIONS'; UPDATE Phrase SET PhraseType = 0 WHERE PhraseKey IN ( 'LU_FERROR_FORGOTPW_NODATA', 'LU_FERROR_UNKNOWN_USERNAME', 'LU_FERROR_UNKNOWN_EMAIL' ); DELETE FROM ConfigurationValues WHERE VariableName = 'Root_Name'; DELETE FROM Phrase WHERE PhraseKey = 'LA_PROMPT_ROOT_NAME'; UPDATE ConfigurationValues SET DisplayOrder = DisplayOrder - 0.01 WHERE ModuleOwner = 'In-Portal' AND `Section` = 'in-portal:configure_categories' AND DisplayOrder > 10.07; # ===== v 5.1.0 ===== UPDATE Events SET Headers = NULL WHERE Headers = ''; UPDATE Events SET MessageType = 'text' WHERE Event = 'FORM.SUBMISSION.REPLY.TO.USER'; ALTER TABLE Forms ADD ProcessUnmatchedEmails TINYINT NOT NULL DEFAULT '0' AFTER EnableEmailCommunication, ADD INDEX (ProcessUnmatchedEmails); ALTER TABLE FormSubmissions ADD MessageId VARCHAR(255) NULL DEFAULT NULL AFTER Notes, ADD INDEX (MessageId); # ===== v 5.1.1-B1 ===== ALTER TABLE PortalUser ADD DisplayToPublic TEXT NULL; UPDATE Phrase SET l<%PRIMARY_LANGUAGE%>_Translation = 'Comments' WHERE PhraseKey = 'LA_FLD_COMMENTS'; ALTER TABLE Category CHANGE `Type` `Type` INT(11) NOT NULL DEFAULT '1', CHANGE `IsSystem` `Protected` TINYINT( 4 ) NOT NULL DEFAULT '0', ADD INDEX ( `Protected` ); UPDATE Category SET `Type` = IF(`Protected` = 1, 2, 1); UPDATE Category SET `Protected` = 1 WHERE ThemeId > 0; ALTER TABLE Category CHANGE CachedDescendantCatsQty CachedDescendantCatsQty INT(11) NOT NULL DEFAULT '0'; ALTER TABLE Events CHANGE `Module` `Module` VARCHAR(40) NOT NULL DEFAULT 'Core'; ALTER TABLE Language CHANGE DateFormat DateFormat VARCHAR(50) NOT NULL DEFAULT 'm/d/Y', CHANGE TimeFormat TimeFormat VARCHAR(50) NOT NULL DEFAULT 'g:i:s A', CHANGE DecimalPoint DecimalPoint VARCHAR(10) NOT NULL DEFAULT '.', CHANGE Charset Charset VARCHAR(20) NOT NULL DEFAULT 'utf-8'; ALTER TABLE ItemReview CHANGE Rating Rating TINYINT(3) UNSIGNED NOT NULL DEFAULT '0'; UPDATE PortalUser SET tz = NULL; ALTER TABLE Category CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL, CHANGE ModifiedById ModifiedById INT(11) NULL DEFAULT NULL; UPDATE Category SET CreatedById = NULL WHERE CreatedById = 0; UPDATE Category SET ModifiedById = NULL WHERE ModifiedById = 0; ALTER TABLE ItemFiles CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL; ALTER TABLE Drafts CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL; UPDATE Drafts SET CreatedById = NULL WHERE CreatedById = 0; ALTER TABLE ItemReview CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL; # ===== v 5.1.1-B2 ===== UPDATE Phrase SET `Module` = 'Core' WHERE PhraseKey = 'LU_SECTION_FILES'; # ===== v 5.1.1-RC1 ===== ALTER TABLE PortalUser CHANGE Phone Phone VARCHAR(255) NOT NULL DEFAULT '', CHANGE City City VARCHAR(255) NOT NULL DEFAULT '', CHANGE Street Street VARCHAR(255) NOT NULL DEFAULT '', CHANGE Zip Zip VARCHAR(20) NOT NULL DEFAULT '', CHANGE ip ip VARCHAR(20) NOT NULL DEFAULT ''; UPDATE Phrase SET l<%PRIMARY_LANGUAGE%>_Translation = 'Use Cron to run Agents' WHERE PhraseKey = 'LA_USECRONFORREGULAREVENT' AND l<%PRIMARY_LANGUAGE%>_Translation = 'Use Cron for Running Regular Events'; # ===== v 5.1.1 ===== # ===== v 5.1.2-B1 ===== DROP TABLE EmailSubscribers; DROP TABLE IgnoreKeywords; DROP TABLE IgnoreKeywords; ALTER TABLE PermissionConfig DROP ErrorMessage; # ===== v 5.1.2-B2 ===== # ===== v 5.1.2-RC1 ===== DROP TABLE Stylesheets; DROP TABLE StylesheetSelectors; DROP TABLE SysCache; DROP TABLE TagAttributes; DROP TABLE TagLibrary; DELETE FROM Phrase WHERE PhraseKey IN ( 'LA_FLD_STYLESHEETID', 'LA_PROMPT_STYLESHEET', 'LA_TAB_STYLESHEETS', 'LA_TITLE_ADDING_STYLESHEET', 'LA_TITLE_EDITING_STYLESHEET', 'LA_TITLE_NEW_STYLESHEET', 'LA_TITLE_STYLESHEETS', 'LA_TOOLTIP_NEWSTYLESHEET', 'LA_COL_SELECTORNAME', 'LA_COL_BASEDON', 'LA_FLD_SELECTORBASE', 'LA_FLD_SELECTORDATA', 'LA_FLD_SELECTORID', 'LA_FLD_SELECTORNAME' ); # ===== v 5.1.2 ===== # ===== v 5.1.3-B1 ===== ALTER TABLE FormSubmissions CHANGE ReferrerURL ReferrerURL TEXT NULL; INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UserEmailActivationTimeout', '', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_config_UserEmailActivationTimeout', 'text', NULL, NULL, 10.051, 0, 0, NULL); # ===== v 5.1.3-B2 ===== ALTER TABLE Modules ADD AppliedDBRevisions TEXT NULL; # ===== v 5.1.3-RC1 ===== # ===== v 5.1.3-RC2 ===== UPDATE Events SET l<%PRIMARY_LANGUAGE%>_Subject = 'New User Registration ( - Activation Email)' WHERE Event = 'USER.ADD.PENDING' AND `Type` = 0 AND l<%PRIMARY_LANGUAGE%>_Subject LIKE '% - Activation Email)%'; INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaxUserName', '', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_text_min_username', 'text', '', 'style="width: 50px;"', 10.03, 2, 0, NULL); UPDATE ConfigurationValues SET GroupDisplayOrder = 1, ValueList = 'style="width: 50px;"' WHERE VariableName = 'Min_UserName'; UPDATE Phrase SET l<%PRIMARY_LANGUAGE%>_Translation = 'User name length (min - max)' WHERE PhraseKey = 'LA_TEXT_MIN_USERNAME' AND l<%PRIMARY_LANGUAGE%>_Translation = 'Minimum user name length'; # ===== v 5.1.3 ===== UPDATE PortalUser SET Modified = NULL; INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:site_domains.delete', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:site_domains.edit', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:site_domains.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:site_domains.view', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:country_states.delete', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:country_states.edit', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:country_states.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:country_states.view', 11, 1, 1, 0); # ===== v 5.2.0-B1 ===== ALTER TABLE PortalUser ADD UserType TINYINT NOT NULL, ADD PrimaryGroupId INT NULL, ADD INDEX (UserType); UPDATE PortalUser u SET u.PrimaryGroupId = (SELECT ug.GroupId FROM <%TABLE_PREFIX%>UserGroup ug WHERE ug.PortalUserId = u.PortalUserId AND ug.PrimaryGroup = 1); UPDATE PortalUser u SET u.UserType = IF(u.PrimaryGroupId = 11, 1, 0); ALTER TABLE UserGroup DROP PrimaryGroup; UPDATE ConfigurationValues SET DisplayOrder = DisplayOrder + 0.01 WHERE `ModuleOwner` = 'In-Portal:Users' AND `Section` = 'in-portal:configure_users' AND DisplayOrder BETWEEN 10.12 AND 20.00; INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_AdminGroup', '11', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_admin_group', 'select', NULL, '0=lu_none||SELECT GroupId as OptionValue, Name as OptionName FROM PortalGroup WHERE Enabled=1 AND Personal=0', 10.12, 0, 1, NULL); ALTER TABLE PortalUser DROP INDEX Login, ADD INDEX Login (Login); ALTER TABLE PortalUser CHANGE Login Login VARCHAR(255) NOT NULL; ALTER TABLE PortalUser ADD OldStyleLogin TINYINT NOT NULL; UPDATE PortalUser SET OldStyleLogin = 1 WHERE (Login <> '') AND (Login NOT REGEXP '^[A-Z0-9_\\-\\.]+$'); DELETE FROM Events WHERE Event = 'USER.PSWD'; UPDATE Phrase SET l<%PRIMARY_LANGUAGE%>_Translation = 'Your password has been reset.' WHERE PhraseKey = 'LU_TEXT_FORGOTPASSHASBEENRESET' AND l<%PRIMARY_LANGUAGE%>_Translation = 'Your password has been reset. The new password has been sent to your e-mail address. You may now login with the new password.'; ALTER TABLE PortalUser DROP MinPwResetDelay, DROP PassResetTime, CHANGE PwResetConfirm PwResetConfirm VARCHAR(255) NOT NULL; UPDATE PortalUser SET PwRequestTime = NULL WHERE PwRequestTime = 0; ALTER TABLE Category ADD DirectLinkEnabled TINYINT NOT NULL DEFAULT '1', ADD DirectLinkAuthKey VARCHAR(20) NOT NULL; UPDATE Category SET DirectLinkAuthKey = SUBSTRING( MD5( CONCAT(CategoryId, ':', ParentId, ':', l<%PRIMARY_LANGUAGE%>_Name, ':b38') ), 1, 20) WHERE DirectLinkAuthKey = ''; INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ExcludeTemplateSectionsFromSearch', '0', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_config_ExcludeTemplateSectionsFromSearch', 'checkbox', '', '', 10.15, 0, 0, NULL); ALTER TABLE Agents ADD SiteDomainLimitation VARCHAR(255) NOT NULL, ADD INDEX (SiteDomainLimitation); UPDATE ConfigurationValues SET DisplayOrder = DisplayOrder + 0.01 WHERE VariableName = 'HTTPAuthBypassIPs'; UPDATE ConfigurationValues SET DisplayOrder = DisplayOrder + 0.01 WHERE ModuleOwner = 'In-Portal' AND `Section` = 'in-portal:configure_advanced' AND Heading = 'la_section_SettingsAdmin' AND DisplayOrder > 40.06; INSERT INTO ConfigurationValues VALUES (DEFAULT, 'StickyGridSelection', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_StickyGridSelection', 'radio', '', '1=la_Yes||0=la_No', 40.07, 0, 0, NULL); ALTER TABLE Forms ADD SubmitNotifyEmail VARCHAR(255) NOT NULL DEFAULT '' AFTER UseSecurityImage; ALTER TABLE FormFields ADD UploadExtensions VARCHAR(255) NOT NULL DEFAULT '' AFTER Validation, ADD UploadMaxSize INT NULL AFTER UploadExtensions; ALTER TABLE Language ADD SynchronizationModes VARCHAR(255) NOT NULL DEFAULT ''; ALTER TABLE PortalUser CHANGE ip IPAddress VARCHAR(15) NOT NULL, ADD IPRestrictions TEXT NULL; ALTER TABLE PortalGroup ADD IPRestrictions TEXT NULL; INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ROOT.RESET.PASSWORD', NULL, 1, 0, 'Core', 'Root Reset Password', 1, 1, 0); ALTER TABLE Skins ADD DisplaySiteNameInHeader TINYINT(1) NOT NULL DEFAULT '1'; DELETE FROM PersistantSessionData WHERE VariableName LIKE 'formsubs_Sort%' AND VariableValue = 'FormFieldId'; ALTER TABLE ItemReview ADD HelpfulCount INT NOT NULL , ADD NotHelpfulCount INT NOT NULL; ALTER TABLE PermissionConfig ADD IsSystem TINYINT(1) NOT NULL DEFAULT '0'; UPDATE PermissionConfig SET IsSystem = 1; INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:permission_types.view', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:permission_types.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:permission_types.edit', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:permission_types.delete', 11, 1, 1, 0); ALTER TABLE Agents ADD Timeout INT(10) UNSIGNED NULL AFTER RunTime, ADD LastTimeoutOn int(10) unsigned default NULL AFTER Timeout, ADD INDEX (Timeout); CREATE TABLE CurlLog ( LogId int(11) NOT NULL AUTO_INCREMENT, Message varchar(255) NOT NULL, PageUrl varchar(255) NOT NULL, RequestUrl varchar(255) NOT NULL, PortalUserId int(11) NOT NULL, SessionKey int(11) NOT NULL, IsAdmin tinyint(4) NOT NULL, PageData text, RequestData text, ResponseData text, RequestDate int(11) DEFAULT NULL, ResponseDate int(11) DEFAULT NULL, ResponseHttpCode int(11) NOT NULL, CurlError varchar(255) NOT NULL, PRIMARY KEY (LogId), KEY Message (Message), KEY PageUrl (PageUrl), KEY RequestUrl (RequestUrl), KEY PortalUserId (PortalUserId), KEY SessionKey (SessionKey), KEY IsAdmin (IsAdmin), KEY RequestDate (RequestDate), KEY ResponseDate (ResponseDate), KEY ResponseHttpCode (ResponseHttpCode), KEY CurlError (CurlError) ); DELETE FROM ConfigurationValues WHERE VariableName = 'Site_Path'; UPDATE ConfigurationValues SET DisplayOrder = DisplayOrder + 0.01 WHERE `Section` = 'in-portal:configure_advanced' AND Heading = 'la_section_SettingsWebsite'; UPDATE ItemTypes SET TitleField = 'Username' WHERE SourceTable = 'PortalUser' AND TitleField = 'Login'; UPDATE SearchConfig SET FieldName = 'Username' WHERE TableName = 'PortalUser' AND FieldName = 'Login'; ALTER TABLE PortalUser DROP INDEX Login; ALTER TABLE PortalUser CHANGE Login Username VARCHAR(255) NOT NULL; ALTER TABLE PortalUser ADD INDEX Username (Username); UPDATE Events SET l<%PRIMARY_LANGUAGE%>_Subject = REPLACE(l<%PRIMARY_LANGUAGE%>_Subject, 'name="Login"', 'name="Username"'), l<%PRIMARY_LANGUAGE%>_Body = REPLACE(l<%PRIMARY_LANGUAGE%>_Body, 'name="Login"', 'name="Username"'); DELETE FROM PersistantSessionData WHERE (VariableName LIKE 'u%]columns_.') OR (VariableName LIKE 'u%_sort%'); DELETE FROM Phrase WHERE Phrase = 'LU_FLD_LOGIN'; UPDATE BanRules SET ItemField = 'Username' WHERE ItemField = 'Login'; DELETE FROM Phrase WHERE PhraseKey IN ( 'LU_USERNAME', 'LU_EMAIL', 'LU_PASSWORD', 'LA_TEXT_LOGIN', 'LA_PROMPT_PASSWORD', 'LA_USE_EMAILS_AS_LOGIN', 'LU_USER_AND_EMAIL_ALREADY_EXIST', 'LU_ENTERFORGOTEMAIL' ); UPDATE ConfigurationValues SET VariableName = 'RegistrationUsernameRequired', Prompt = 'la_config_RegistrationUsernameRequired' WHERE VariableName = 'Email_As_Login'; UPDATE ConfigurationValues SET VariableValue = IF(VariableValue = 1, 0, 1) WHERE VariableName = 'RegistrationUsernameRequired'; INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PerformExactSearch', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_PerformExactSearch', 'checkbox', '', '', '10.10', 0, 0, 'la_hint_PerformExactSearch'); UPDATE Phrase SET PhraseType = 1 WHERE PhraseKey IN ( 'LA_USERS_SUBSCRIBER_GROUP', 'LA_PROMPT_DUPREVIEWS', 'LA_PROMPT_DUPREVIEWS', 'LA_PROMPT_DUPRATING', 'LA_PROMPT_OVERWRITEPHRASES', 'LA_TEXT_BACKUP_ACCESS', 'LA_PHRASETYPE_BOTH', 'LA_TOOLTIP_NEWLISTING' ); UPDATE Phrase SET PhraseType = 0 WHERE PhraseKey IN ('LU_TITLE_SHIPPINGINFORMATION', 'LU_COMM_LASTQUATER'); UPDATE Phrase SET Phrase = REPLACE(Phrase, 'lu_', 'la_'), PhraseKey = UPPER(Phrase) WHERE PhraseKey IN ('LU_OPT_AUTODETECT', 'LU_OPT_COOKIES', 'LU_OPT_QUERYSTRING'); UPDATE ConfigurationValues SET ValueList = REPLACE(ValueList, 'lu_', 'la_') WHERE VariableName = 'CookieSessions'; DELETE FROM Phrase WHERE PhraseKey IN ('LU_INVALID_PASSWORD', 'LA_OF', 'LU_TITLE_REVIEWPRODUCT'); UPDATE Phrase SET PhraseType = 2 WHERE PhraseType = 1 AND (PhraseKey LIKE 'lu_field_%' OR PhraseKey = 'LA_TEXT_VALID'); UPDATE Phrase SET Phrase = REPLACE(Phrase, 'la_', 'lc_'), PhraseKey = UPPER(Phrase) WHERE PhraseType = 2; UPDATE Phrase SET Phrase = REPLACE(Phrase, 'lu_', 'lc_'), PhraseKey = UPPER(Phrase) WHERE PhraseType = 2; UPDATE SearchConfig SET DisplayName = REPLACE(DisplayName, 'lu_', 'lc_') WHERE DisplayName IN ( 'lu_field_newitem', 'lu_field_popitem', 'lu_field_hotitem', 'lu_field_resourceid', 'lu_field_createdbyid', 'lu_field_priority', 'lu_field_status', 'lu_field_createdon', 'lu_field_description', 'lu_field_name', 'lu_field_modified', 'lu_field_modifiedbyid', 'lu_field_ParentPath', 'lu_field_ParentId', 'lu_field_MetaKeywords', 'lu_field_MetaDescription', 'lu_field_EditorsPick', 'lu_field_CategoryId', 'lu_field_CachedNavBar', 'lu_field_CachedDescendantCatsQty', 'lu_field_hits', 'lu_field_cachedrating', 'lu_field_cachedvotesqty', 'lu_field_cachedreviewsqty', 'lu_field_orgid' ); CREATE TABLE SpamReports ( ReportId int(11) NOT NULL AUTO_INCREMENT, ItemPrefix varchar(255) NOT NULL, ItemId int(11) NOT NULL, MessageText text, ReportedOn int(11) DEFAULT NULL, ReportedById int(11) DEFAULT NULL, PRIMARY KEY (ReportId), KEY ItemPrefix (ItemPrefix), KEY ItemId (ItemId), KEY ReportedById (ReportedById) ); DELETE FROM Phrase WHERE PhraseKey IN ( 'LA_SECTION_SETTINGSCACHING', 'LA_CONFIG_CACHEHANDLER', 'LA_CONFIG_MEMCACHESERVERS', 'LA_HINT_MEMCACHESERVERS' ); DELETE FROM ConfigurationValues WHERE VariableName IN ('CacheHandler', 'MemcacheServers'); CREATE TABLE PromoBlocks ( BlockId int(11) NOT NULL AUTO_INCREMENT, Title varchar(50) NOT NULL DEFAULT '', Priority int(11) NOT NULL DEFAULT '0', Status tinyint(1) NOT NULL DEFAULT '0', l1_Image varchar(255) NOT NULL DEFAULT '', l2_Image varchar(255) NOT NULL DEFAULT '', l3_Image varchar(255) NOT NULL DEFAULT '', l4_Image varchar(255) NOT NULL DEFAULT '', l5_Image varchar(255) NOT NULL DEFAULT '', CSSClassName varchar(255) NOT NULL DEFAULT '', LinkType tinyint(1) NOT NULL DEFAULT '1', CategoryId int(11) NOT NULL DEFAULT '0', ExternalLink varchar(255) NOT NULL DEFAULT '', OpenInNewWindow tinyint(3) unsigned NOT NULL DEFAULT '0', ScheduleFromDate int(11) DEFAULT NULL, ScheduleToDate int(11) DEFAULT NULL, NumberOfClicks int(11) NOT NULL DEFAULT '0', NumberOfViews int(11) NOT NULL DEFAULT '0', Sticky tinyint(1) NOT NULL DEFAULT '0', Html text, l1_Html text, l2_Html text, l3_Html text, l4_Html text, l5_Html text, PRIMARY KEY (BlockId), KEY OpenInNewWindow (OpenInNewWindow) ); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoRotationDelay', '7', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoRotationDelay', 'text', '', '', 10.01, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionTime', '0.6', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionTime', 'text', '', '', 10.02, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionControls', '1', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionControls', 'select', '', '1=la_Enabled||0=la_Disabled', 10.03, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionEffect', 'fade', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionEffect', 'select', '', 'fade=la_opt_AnimationFade||slide=la_opt_AnimationSlide', 10.04, 0, 0, NULL); UPDATE Phrase SET l<%PRIMARY_LANGUAGE%>_ColumnTranslation = l<%PRIMARY_LANGUAGE%>_Translation WHERE PhraseKey IN ('LA_FLD_CATEGORY', 'LA_FLD_ORDER'); CREATE TABLE PageRevisions ( RevisionId int(11) NOT NULL AUTO_INCREMENT, PageId int(11) NOT NULL, RevisionNumber int(11) NOT NULL, IsDraft tinyint(4) NOT NULL, FromRevisionId int(11) NOT NULL, CreatedById int(11) DEFAULT NULL, CreatedOn int(11) DEFAULT NULL, AutoSavedOn int(11) DEFAULT NULL, `Status` tinyint(4) NOT NULL DEFAULT '2', PRIMARY KEY (RevisionId), KEY PageId (PageId), KEY RevisionNumber (RevisionNumber), KEY IsDraft (IsDraft), KEY `Status` (`Status`) ); ALTER TABLE Category ADD LiveRevisionNumber INT NOT NULL DEFAULT '1' AFTER PageExpiration, ADD INDEX (LiveRevisionNumber); ALTER TABLE PageContent ADD RevisionId INT NOT NULL AFTER PageId, ADD INDEX (RevisionId); ALTER TABLE PermissionConfig CHANGE PermissionName PermissionName VARCHAR(255) NOT NULL DEFAULT ''; INSERT INTO PermissionConfig VALUES (DEFAULT, 'CATEGORY.REVISION.ADD', 'la_PermName_Category.Revision.Add_desc', 'In-Portal', 1); INSERT INTO PermissionConfig VALUES (DEFAULT, 'CATEGORY.REVISION.ADD.PENDING', 'la_PermName_Category.Revision.Add.Pending_desc', 'In-Portal', 1); INSERT INTO PermissionConfig VALUES (DEFAULT, 'CATEGORY.REVISION.MODERATE', 'la_PermName_Category.Revision.Moderate_desc', 'In-Portal', 1); INSERT INTO PermissionConfig VALUES (DEFAULT, 'CATEGORY.REVISION.HISTORY.VIEW', 'la_PermName_Category.Revision.History.View_desc', 'In-Portal', 1); INSERT INTO PermissionConfig VALUES (DEFAULT, 'CATEGORY.REVISION.HISTORY.RESTORE', 'la_PermName_Category.Revision.History.Restore_desc', 'In-Portal', 1); INSERT INTO Permissions VALUES(DEFAULT, 'CATEGORY.REVISION.ADD', 11, 1, 0, 1); INSERT INTO Permissions VALUES(DEFAULT, 'CATEGORY.REVISION.HISTORY.VIEW', 11, 1, 0, 1); INSERT INTO Permissions VALUES(DEFAULT, 'CATEGORY.REVISION.HISTORY.RESTORE', 11, 1, 0, 1); ALTER TABLE EmailQueue ADD `LogData` TEXT; UPDATE Permissions SET Permission = REPLACE(Permission, 'agents', 'scheduled_tasks') WHERE Permission LIKE 'in-portal:agents%'; DELETE FROM Phrase WHERE PhraseKey IN ( 'LA_TITLE_ADDINGAGENT', 'LA_TITLE_EDITINGAGENT', 'LA_TITLE_NEWAGENT', 'LA_TITLE_AGENTS', 'LA_TOOLTIP_NEWAGENT' ); UPDATE Phrase SET l<%PRIMARY_LANGUAGE%>_Translation = REPLACE(l<%PRIMARY_LANGUAGE%>_Translation, 'Agents', 'Scheduled Tasks') WHERE PhraseKey IN ( 'LA_USECRONFORREGULAREVENT', 'LA_HINT_SYSTEMTOOLSRESETPARSEDCACHEDDATA', 'LA_HINT_SYSTEMTOOLSRESETCONFIGSANDPARSEDDATA' ); DELETE FROM PersistantSessionData WHERE VariableName LIKE 'agent%'; RENAME TABLE <%TABLE_PREFIX%>Agents TO <%TABLE_PREFIX%>ScheduledTasks; ALTER TABLE ScheduledTasks CHANGE AgentId ScheduledTaskId INT(11) NOT NULL AUTO_INCREMENT, CHANGE AgentName Name VARCHAR(255) NOT NULL DEFAULT '', CHANGE AgentType `Type` TINYINT(3) UNSIGNED NOT NULL DEFAULT '1'; ALTER TABLE ScheduledTasks DROP INDEX AgentType, ADD INDEX `Type` (`Type`); UPDATE ConfigurationValues SET VariableName = 'RunScheduledTasksFromCron' WHERE VariableName = 'UseCronForRegularEvent'; CREATE TABLE ItemFilters ( FilterId int(11) NOT NULL AUTO_INCREMENT, ItemPrefix varchar(255) NOT NULL, FilterField varchar(255) NOT NULL, FilterType varchar(100) NOT NULL, Enabled tinyint(4) NOT NULL DEFAULT '1', RangeCount int(11) DEFAULT NULL, PRIMARY KEY (FilterId), KEY ItemPrefix (ItemPrefix), KEY Enabled (Enabled) ); UPDATE ConfigurationValues SET HintLabel = CONCAT('hint:', Prompt) WHERE VariableName IN ('ForceModRewriteUrlEnding', 'PerformExactSearch'); DELETE FROM Phrase WHERE PhraseKey IN ( 'LA_TEXT_PROMOSETTINGS', 'LA_CONFIG_PROMOROTATIONDELAY', 'LA_CONFIG_PROMOTRANSITIONTIME', 'LA_CONFIG_PROMOTRANSITIONCONTROLS', 'LA_CONFIG_PROMOTRANSITIONEFFECT' ); DELETE FROM ConfigurationValues WHERE VariableName IN ('PromoRotationDelay', 'PromoTransitionTime', 'PromoTransitionControls', 'PromoTransitionEffect'); DELETE FROM Permissions WHERE Permission LIKE 'in-portal:promo_blocks.%'; CREATE TABLE PromoBlockGroups ( PromoBlockGroupId int(11) NOT NULL AUTO_INCREMENT, Title varchar(255) NOT NULL DEFAULT '', CreatedOn int(10) unsigned DEFAULT NULL, `Status` tinyint(1) NOT NULL DEFAULT '1', RotationDelay decimal(9,2) DEFAULT NULL, TransitionTime decimal(9,2) DEFAULT NULL, TransitionControls tinyint(1) NOT NULL DEFAULT '1', TransitionEffect varchar(255) NOT NULL DEFAULT '', TransitionEffectCustom varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (PromoBlockGroupId) ); ALTER TABLE Category ADD PromoBlockGroupId int(10) unsigned NOT NULL DEFAULT '0', ADD INDEX (PromoBlockGroupId); ALTER TABLE PromoBlocks ADD PromoBlockGroupId int(10) unsigned NOT NULL DEFAULT '0', ADD INDEX (PromoBlockGroupId); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'DebugOnlyPromoBlockGroupConfigurator', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_DebugOnlyPromoBlockGroupConfigurator', 'checkbox', '', '', 40.13, 0, 0, NULL); UPDATE ConfigurationValues SET DisplayOrder = DisplayOrder + 0.01 WHERE VariableName IN ('RememberLastAdminTemplate', 'UseHTTPAuth', 'HTTPAuthUsername', 'HTTPAuthPassword', 'HTTPAuthBypassIPs'); INSERT INTO PromoBlockGroups VALUES (DEFAULT, 'Default Group', UNIX_TIMESTAMP(), '1', '7.00', '0.60', '1', 'fade', ''); UPDATE PromoBlocks SET PromoBlockGroupId = 1; INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.view', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.edit', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.delete', 11, 1, 1, 0); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaintenanceMessageFront', 'Website is currently undergoing the upgrades. Please come back shortly!', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_MaintenanceMessageFront', 'textarea', '', 'style="width: 100%; height: 100px;"', '15.01', 0, 0, 'hint:la_config_MaintenanceMessageFront'); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaintenanceMessageAdmin', 'Website is currently undergoing the upgrades. Please come back shortly!', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_MaintenanceMessageAdmin', 'textarea', '', 'style="width: 100%; height: 100px;"', '15.02', 0, 0, 'hint:la_config_MaintenanceMessageAdmin'); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'SoftMaintenanceTemplate', 'maintenance', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_SoftMaintenanceTemplate', 'text', '', 'style="width: 200px;"', '15.03', 0, 0, 'hint:la_config_SoftMaintenanceTemplate'); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HardMaintenanceTemplate', 'maintenance', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_HardMaintenanceTemplate', 'text', '', 'style="width: 200px;"', '15.04', 0, 0, 'hint:la_config_HardMaintenanceTemplate'); UPDATE ConfigurationValues SET VariableName = 'DefaultEmailSender' WHERE VariableName = 'Smtp_AdminMailFrom'; INSERT INTO ConfigurationValues VALUES(DEFAULT, 'DefaultEmailRecipients', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_config_DefaultEmailRecipients', 'text', NULL, NULL, 50.10, 0, 0, NULL); ALTER TABLE SiteDomains ADD DefaultEmailRecipients TEXT NULL AFTER AdminEmail; UPDATE ConfigurationValues SET Section = 'in-portal:configure_advanced', Heading = 'la_section_Settings3rdPartyAPI', DisplayOrder = 80.01 WHERE VariableName = 'YahooApplicationId'; UPDATE ConfigurationValues SET DisplayOrder = DisplayOrder - 0.01 WHERE VariableName IN ('Search_MinKeyword_Length', 'ExcludeTemplateSectionsFromSearch'); UPDATE Phrase SET l<%PRIMARY_LANGUAGE%>_ColumnTranslation = l<%PRIMARY_LANGUAGE%>_Translation WHERE PhraseKey IN ('LA_FLD_ADDRESSLINE1', 'LA_FLD_ADDRESSLINE2', 'LA_FLD_CITY', 'LA_FLD_COMPANY', 'LA_FLD_FAX', 'LA_FLD_STATE', 'LA_FLD_ZIP'); DELETE FROM Phrase WHERE PhraseKey IN ('LA_TEXT_RESTRICTIONS', 'LA_USERS_REVIEW_DENY', 'LA_USERS_VOTES_DENY'); DELETE FROM ConfigurationValues WHERE VariableName IN ('User_Review_Deny', 'User_Votes_Deny'); ALTER TABLE PortalUser ADD FrontLanguage INT(11) NULL AFTER PwRequestTime; ALTER TABLE PortalUser DROP INDEX AdminLanguage; UPDATE PortalUser SET FrontLanguage = 1 WHERE UserType = 0; ALTER TABLE PortalUser ADD PrevEmails TEXT NULL AFTER Email, ADD EmailVerified TINYINT NOT NULL AFTER `Status`; UPDATE PortalUser SET EmailVerified = 1; INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'USER.EMAIL.CHANGE.VERIFY', NULL, 1, 0, 'Core', 'Changed E-mail Verification', 0, 1, 1); INSERT INTO Events (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'USER.EMAIL.CHANGE.UNDO', NULL, 1, 0, 'Core', 'Changed E-mail Rollback', 0, 1, 1); ALTER TABLE Category ADD RequireSSL TINYINT NOT NULL DEFAULT '0', ADD RequireLogin TINYINT NOT NULL DEFAULT '0'; INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UpdateCountersOnFilterChange', '1', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_config_UpdateCountersOnFilterChange', 'checkbox', '', '', 10.15, 0, 0, NULL); # use new table name (see /core/install.php:390)! ALTER TABLE UserSessions DROP `tz`; ALTER TABLE UserSessions ADD `TimeZone` VARCHAR(255) NOT NULL AFTER `GroupList`; ALTER TABLE PortalUser DROP `tz`; ALTER TABLE PortalUser ADD `TimeZone` VARCHAR(255) NOT NULL AFTER `dob`; UPDATE SearchConfig SET FieldName = 'TimeZone' WHERE FieldName = 'tz' AND TableName = 'PortalUser'; RENAME TABLE <%TABLE_PREFIX%>BanRules TO <%TABLE_PREFIX%>UserBanRules; RENAME TABLE <%TABLE_PREFIX%>Cache TO <%TABLE_PREFIX%>SystemCache; RENAME TABLE <%TABLE_PREFIX%>ConfigurationValues TO <%TABLE_PREFIX%>SystemSettings; RENAME TABLE <%TABLE_PREFIX%>Category TO <%TABLE_PREFIX%>Categories; UPDATE ItemTypes SET SourceTable = 'Categories' WHERE ItemType = 1; UPDATE ItemTypes SET SourceTable = 'Users' WHERE ItemType = 6; UPDATE SearchConfig SET TableName = 'Categories' WHERE TableName = 'Category'; UPDATE SearchConfig SET TableName = 'CustomFields' WHERE TableName = 'CustomField'; UPDATE SearchConfig SET TableName = 'Users' WHERE TableName = 'PortalUser'; UPDATE StatItem SET ValueSQL = REPLACE(ValueSQL, '<%prefix%>Category', '<%prefix%>Categories'); UPDATE StatItem SET ValueSQL = REPLACE(ValueSQL, '<%prefix%>ItemReview', '<%prefix%>CatalogReviews'); UPDATE StatItem SET ValueSQL = REPLACE(ValueSQL, '<%prefix%>Language', '<%prefix%>Languages'); UPDATE StatItem SET ValueSQL = REPLACE(ValueSQL, '<%prefix%>PortalGroup', '<%prefix%>UserGroups'); UPDATE StatItem SET ValueSQL = REPLACE(ValueSQL, '<%prefix%>PortalUser', '<%prefix%>Users'); UPDATE StatItem SET ValueSQL = REPLACE(ValueSQL, '<%prefix%>Theme', '<%prefix%>Themes'); UPDATE StatItem SET ValueSQL = REPLACE(ValueSQL, '<%prefix%>UserSession', '<%prefix%>UserSessions'); UPDATE SystemSettings SET ValueList = REPLACE(ValueList, 'CustomField', 'CustomFields'); UPDATE SystemSettings SET ValueList = REPLACE(ValueList, 'PortalGroup', 'UserGroups'); UPDATE Counters SET CountQuery = 'SELECT COUNT(*) FROM <%PREFIX%>Users WHERE Status = 1', TablesAffected = '|Users|' WHERE `Name` = 'members_count'; UPDATE Counters SET CountQuery = REPLACE(CountQuery, '<%PREFIX%>UserSession', '<%PREFIX%>UserSessions'), TablesAffected = REPLACE(TablesAffected, '|UserSession|', '|UserSessions|'); RENAME TABLE <%TABLE_PREFIX%>CustomField TO <%TABLE_PREFIX%>CustomFields; RENAME TABLE <%TABLE_PREFIX%>Drafts TO <%TABLE_PREFIX%>FormSubmissionReplyDrafts; RENAME TABLE <%TABLE_PREFIX%>Events TO <%TABLE_PREFIX%>EmailEvents; DELETE FROM PersistantSessionData WHERE VariableName LIKE '%custom_filter%'; RENAME TABLE <%TABLE_PREFIX%>Favorites TO <%TABLE_PREFIX%>UserFavorites; RENAME TABLE <%TABLE_PREFIX%>Images TO <%TABLE_PREFIX%>CatalogImages; RENAME TABLE <%TABLE_PREFIX%>ItemFiles TO <%TABLE_PREFIX%>CatalogFiles; RENAME TABLE <%TABLE_PREFIX%>ItemRating TO <%TABLE_PREFIX%>CatalogRatings; RENAME TABLE <%TABLE_PREFIX%>ItemReview TO <%TABLE_PREFIX%>CatalogReviews; RENAME TABLE <%TABLE_PREFIX%>Language TO <%TABLE_PREFIX%>Languages; RENAME TABLE <%TABLE_PREFIX%>PermCache TO <%TABLE_PREFIX%>CategoryPermissionsCache; RENAME TABLE <%TABLE_PREFIX%>PermissionConfig TO <%TABLE_PREFIX%>CategoryPermissionsConfig; RENAME TABLE <%TABLE_PREFIX%>Phrase TO <%TABLE_PREFIX%>LanguageLabels; RENAME TABLE <%TABLE_PREFIX%>PortalGroup TO <%TABLE_PREFIX%>UserGroups; RENAME TABLE <%TABLE_PREFIX%>PersistantSessionData TO <%TABLE_PREFIX%>UserPersistentSessionData; RENAME TABLE <%TABLE_PREFIX%>PortalUser TO <%TABLE_PREFIX%>Users; RENAME TABLE <%TABLE_PREFIX%>PortalUserCustomData TO <%TABLE_PREFIX%>UserCustomData; RENAME TABLE <%TABLE_PREFIX%>RelatedSearches TO <%TABLE_PREFIX%>CategoryRelatedSearches; RENAME TABLE <%TABLE_PREFIX%>Relationship TO <%TABLE_PREFIX%>CatalogRelationships; RENAME TABLE <%TABLE_PREFIX%>SearchLog TO <%TABLE_PREFIX%>SearchLogs; RENAME TABLE <%TABLE_PREFIX%>Skins TO <%TABLE_PREFIX%>AdminSkins; RENAME TABLE <%TABLE_PREFIX%>SubmissionLog TO <%TABLE_PREFIX%>FormSubmissionReplies; RENAME TABLE <%TABLE_PREFIX%>Theme TO <%TABLE_PREFIX%>Themes; RENAME TABLE <%TABLE_PREFIX%>UserGroup TO <%TABLE_PREFIX%>UserGroupRelations; RENAME TABLE <%TABLE_PREFIX%>Visits TO <%TABLE_PREFIX%>UserVisits; RENAME TABLE <%TABLE_PREFIX%>SessionLogs TO <%TABLE_PREFIX%>UserSessionLogs; DELETE FROM LanguageLabels WHERE PhraseKey = 'LA_FLD_RUNMODE'; ALTER TABLE ScheduledTasks DROP RunMode; INSERT INTO SystemSettings VALUES(DEFAULT, 'CKFinderLicenseName', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_Settings3rdPartyAPI', 'la_config_CKFinderLicenseName', 'text', NULL, NULL, 80.03, 0, 0, NULL); INSERT INTO SystemSettings VALUES(DEFAULT, 'CKFinderLicenseKey', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_Settings3rdPartyAPI', 'la_config_CKFinderLicenseKey', 'text', NULL, NULL, 80.04, 0, 0, NULL); INSERT INTO SystemSettings VALUES(DEFAULT, 'EnablePageContentRevisionControl', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_EnablePageContentRevisionControl', 'checkbox', '', '', 40.19, 0, 0, NULL); # ===== v 5.2.0-B2 ===== ALTER TABLE Users CHANGE Username Username varchar(255) NOT NULL DEFAULT '', CHANGE IPAddress IPAddress varchar(15) NOT NULL DEFAULT '', CHANGE PwResetConfirm PwResetConfirm varchar(255) NOT NULL DEFAULT ''; ALTER TABLE UserSessions CHANGE TimeZone TimeZone varchar(255) NOT NULL DEFAULT ''; ALTER TABLE CountryStates CHANGE l1_Name l1_Name varchar(255) NOT NULL DEFAULT '', CHANGE l2_Name l2_Name varchar(255) NOT NULL DEFAULT '', CHANGE l3_Name l3_Name varchar(255) NOT NULL DEFAULT '', CHANGE l4_Name l4_Name varchar(255) NOT NULL DEFAULT '', CHANGE l5_Name l5_Name varchar(255) NOT NULL DEFAULT ''; ALTER TABLE Categories CHANGE DirectLinkAuthKey DirectLinkAuthKey varchar(20) NOT NULL DEFAULT ''; ALTER TABLE ScheduledTasks CHANGE SiteDomainLimitation SiteDomainLimitation varchar(255) NOT NULL DEFAULT ''; ALTER TABLE ItemFilters CHANGE ItemPrefix ItemPrefix varchar(255) NOT NULL DEFAULT '', CHANGE FilterField FilterField varchar(255) NOT NULL DEFAULT '', CHANGE FilterType FilterType varchar(100) NOT NULL DEFAULT ''; ALTER TABLE SpamReports CHANGE ItemPrefix ItemPrefix varchar(255) NOT NULL DEFAULT ''; ALTER TABLE CachedUrls CHANGE ParsedVars ParsedVars text; ALTER TABLE CurlLog CHANGE Message Message varchar(255) NOT NULL DEFAULT '', CHANGE PageUrl PageUrl varchar(255) NOT NULL DEFAULT '', CHANGE RequestUrl RequestUrl varchar(255) NOT NULL DEFAULT '', CHANGE CurlError CurlError varchar(255) NOT NULL DEFAULT ''; UPDATE SystemSettings SET DisplayOrder = DisplayOrder + 0.01 WHERE ModuleOwner = 'In-Portal' AND Section = 'in-portal:configure_advanced' AND Heading = 'la_section_SettingsAdmin' AND DisplayOrder > 40.11; INSERT INTO SystemSettings VALUES(DEFAULT, 'DefaultGridPerPage', '20', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_DefaultGridPerPage', 'select', '', '10=+10||20=+20||50=+50||100=+100||500=+500', 40.12, 0, 0, NULL); ALTER TABLE EmailEvents ADD LastChanged INT UNSIGNED NULL; ALTER TABLE PromoBlocks DROP Html, CHANGE Status Status TINYINT(1) NOT NULL DEFAULT '1', CHANGE CategoryId CategoryId INT(11) NULL; # ===== v 5.2.0-B3 ===== ALTER TABLE Languages ADD HtmlEmailTemplate TEXT NULL, ADD TextEmailTemplate TEXT NULL; ALTER TABLE EmailLog CHANGE fromuser `From` VARCHAR(255) NOT NULL DEFAULT ''; ALTER TABLE EmailLog CHANGE addressto `To` VARCHAR(255) NOT NULL DEFAULT ''; ALTER TABLE EmailLog CHANGE subject `Subject` VARCHAR(255) NOT NULL DEFAULT ''; ALTER TABLE EmailLog CHANGE `timestamp` SentOn INT(11) NULL; ALTER TABLE EmailLog CHANGE `event` EventName VARCHAR(255) NOT NULL DEFAULT ''; ALTER TABLE EmailLog ADD OtherRecipients TEXT NULL AFTER `To`; ALTER TABLE EmailLog ADD HtmlBody LONGTEXT NULL AFTER `Subject`, ADD TextBody LONGTEXT NULL AFTER HtmlBody; ALTER TABLE EmailLog ADD AccessKey VARCHAR(32) NOT NULL DEFAULT ''; INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:emaillog.edit', 11, 1, 1, 0); DELETE FROM LanguageLabels WHERE PhraseKey = 'LA_PROMPT_FROMUSERNAME'; INSERT INTO SystemSettings VALUES(DEFAULT, 'EmailLogRotationInterval', '-1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_config_EmailLogRotationInterval', 'select', NULL, '=la_opt_EmailLogKeepNever||86400=la_opt_OneDay||604800=la_opt_OneWeek||1209600=la_opt_TwoWeeks||2419200=la_opt_OneMonth||7257600=la_opt_ThreeMonths||29030400=la_opt_OneYear||-1=la_opt_EmailLogKeepForever', 50.11, 0, 0, 'hint:la_config_EmailLogRotationInterval'); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:spam_reports.view', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:spam_reports.edit', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:spam_reports.delete', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:item_filters.view', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:item_filters.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:item_filters.edit', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:item_filters.delete', 11, 1, 1, 0); ALTER TABLE SlowSqlCapture CHANGE QueryCrc QueryCrc BIGINT(11) NOT NULL DEFAULT '0'; UPDATE SlowSqlCapture SET QueryCrc = CAST((QueryCrc & 0xFFFFFFFF) AS UNSIGNED INTEGER) WHERE QueryCrc < 0; ALTER TABLE ImportCache CHANGE VarName VarName BIGINT(11) NOT NULL DEFAULT '0'; UPDATE ImportCache SET VarName = CAST((VarName & 0xFFFFFFFF) AS UNSIGNED INTEGER) WHERE VarName < 0; ALTER TABLE PageContent CHANGE ContentNum ContentNum BIGINT(11) NOT NULL DEFAULT '0'; UPDATE PageContent SET ContentNum = CAST((ContentNum & 0xFFFFFFFF) AS UNSIGNED INTEGER) WHERE ContentNum < 0; ALTER TABLE CachedUrls CHANGE Hash Hash BIGINT(11) NOT NULL DEFAULT '0'; UPDATE CachedUrls SET Hash = CAST((Hash & 0xFFFFFFFF) AS UNSIGNED INTEGER) WHERE Hash < 0; ALTER TABLE EmailEvents ADD BindToSystemEvent VARCHAR(255) NOT NULL DEFAULT ''; CREATE TABLE SystemEventSubscriptions ( SubscriptionId int(11) NOT NULL AUTO_INCREMENT, EmailEventId int(11) DEFAULT NULL, SubscriberEmail varchar(255) NOT NULL DEFAULT '', UserId int(11) DEFAULT NULL, CategoryId int(11) DEFAULT NULL, IncludeSublevels tinyint(4) NOT NULL DEFAULT '1', ItemId int(11) DEFAULT NULL, ParentItemId int(11) DEFAULT NULL, SubscribedOn int(11) DEFAULT NULL, PRIMARY KEY (SubscriptionId), KEY EmailEventId (EmailEventId) ); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:system_event_subscriptions.view', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:system_event_subscriptions.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:system_event_subscriptions.edit', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:system_event_subscriptions.delete', 11, 1, 1, 0); UPDATE LanguageLabels SET l1_ColumnTranslation = l1_Translation, l2_ColumnTranslation = l2_Translation, l3_ColumnTranslation = l3_Translation, l4_ColumnTranslation = l4_Translation, l5_ColumnTranslation = l5_Translation WHERE PhraseKey IN ('LA_FLD_BINDTOSYSTEMEVENT', 'LA_FLD_CATEGORYID'); UPDATE Categories SET l1_MenuTitle = l1_Name WHERE l1_Name = 'Content'; UPDATE SystemSettings SET ValueList = '0=la_opt_QueryString||1=la_opt_Cookies||2=la_opt_AutoDetect' WHERE VariableName = 'CookieSessions'; # ===== v 5.2.0-RC1 ===== UPDATE LanguageLabels SET l<%PRIMARY_LANGUAGE%>_Translation = '<TITLE> Tag' WHERE PhraseKey = 'LA_FLD_PAGECONTENTTITLE'; ALTER TABLE EmailLog ADD EventType TINYINT(4) NULL AFTER EventName; DELETE FROM UserPersistentSessionData WHERE VariableName IN ('email-log[Default]columns_.', 'promo-block[Default]columns_.'); ALTER TABLE Categories ADD NamedParentPathHash INT UNSIGNED NOT NULL DEFAULT '0' AFTER NamedParentPath, ADD CachedTemplateHash INT UNSIGNED NOT NULL DEFAULT '0' AFTER CachedTemplate, ADD INDEX (NamedParentPathHash), ADD INDEX (CachedTemplateHash); # ===== v 5.2.0 ===== INSERT INTO SystemSettings VALUES(DEFAULT, 'CategoryPermissionRebuildMode', '3', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_config_CategoryPermissionRebuildMode', 'select', NULL, '1=la_opt_Manual||2=la_opt_Silent||3=la_opt_Automatic', 10.11, 0, 0, 'hint:la_config_CategoryPermissionRebuildMode'); DELETE FROM LanguageLabels WHERE PhraseKey = 'LA_CONFIG_QUICKCATEGORYPERMISSIONREBUILD'; ALTER TABLE ScheduledTasks ADD RunSchedule VARCHAR(255) NOT NULL DEFAULT '* * * * *' AFTER Event; DELETE FROM UserPersistentSessionData WHERE VariableName = 'scheduled-task[Default]columns_.'; DELETE FROM LanguageLabels WHERE PhraseKey = 'LA_FLD_RUNINTERVAL'; ALTER TABLE Languages ADD ShortDateFormat VARCHAR(255) NOT NULL DEFAULT 'm/d' AFTER DateFormat, ADD ShortTimeFormat VARCHAR(255) NOT NULL DEFAULT 'g:i A' AFTER TimeFormat; UPDATE Languages SET ShortDateFormat = REPLACE(REPLACE(DateFormat, '/Y', ''), '/y', ''), ShortTimeFormat = REPLACE(TimeFormat, ':s', ''); UPDATE SystemSettings SET GroupDisplayOrder = 1 WHERE VariableName = 'AdminConsoleInterface'; UPDATE SystemSettings SET Section = 'in-portal:configure_general', Prompt = 'la_config_AdminConsoleInterface', DisplayOrder = 50.01, GroupDisplayOrder = 2 WHERE VariableName = 'AllowAdminConsoleInterfaceChange'; DELETE FROM LanguageLabels WHERE PhraseKey = 'LA_CONFIG_ALLOWADMINCONSOLEINTERFACECHANGE'; UPDATE SystemSettings SET DisplayOrder = DisplayOrder - 0.01 WHERE ModuleOwner = 'In-Portal' AND Section = 'in-portal:configure_advanced' AND DisplayOrder > 40.02 AND DisplayOrder < 50; UPDATE SystemSettings SET VariableValue = 1 WHERE VariableName = 'UseOutputCompression'; ALTER TABLE EmailQueue CHANGE LogData LogData LONGTEXT NULL DEFAULT NULL; DELETE FROM UserPersistentSessionData WHERE VariableName = 'mailing-list[Default]columns_.'; INSERT INTO Permissions VALUES(DEFAULT, 'in-portal:configure_general.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES(DEFAULT, 'in-portal:configure_advanced.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES(DEFAULT, 'in-portal:configure_categories.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES(DEFAULT, 'in-portal:configure_users.add', 11, 1, 1, 0); # ===== v 5.2.1-B1 ===== UPDATE SystemSettings SET DisplayOrder = 30.05 WHERE VariableName = 'Force_HTTP_When_SSL_Not_Required'; INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'USER.NEW.PASSWORD', NULL, 1, 0, 'Core', 'Sends new password to an existing user', 0, 1, 0); INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'USER.ADD.BYADMIN', NULL, 1, 0, 'Core', 'Sends password to a new user', 0, 1, 0); CREATE TABLE SystemLog ( LogId int(11) NOT NULL AUTO_INCREMENT, LogUniqueId int(11) DEFAULT NULL, LogLevel tinyint(4) NOT NULL DEFAULT '7', LogType tinyint(4) NOT NULL DEFAULT '3', LogCode int(11) DEFAULT NULL, LogMessage longtext, LogTimestamp int(11) DEFAULT NULL, LogDate datetime DEFAULT NULL, LogEventName varchar(100) NOT NULL DEFAULT '', LogHostname varchar(255) NOT NULL DEFAULT '', LogRequestSource tinyint(4) DEFAULT NULL, LogRequestURI varchar(255) NOT NULL DEFAULT '', LogRequestData longtext, LogUserId int(11) DEFAULT NULL, LogInterface tinyint(4) DEFAULT NULL, IpAddress varchar(15) NOT NULL DEFAULT '', LogSessionKey int(11) DEFAULT NULL, LogSessionData longtext, LogBacktrace longtext, LogSourceFilename varchar(255) NOT NULL DEFAULT '', LogSourceFileLine int(11) DEFAULT NULL, LogProcessId bigint(20) unsigned DEFAULT NULL, LogMemoryUsed bigint(20) unsigned NOT NULL, LogUserData longtext NOT NULL, LogNotificationStatus tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (LogId), KEY LogLevel (LogLevel), KEY LogType (LogType), KEY LogNotificationStatus (LogNotificationStatus) ); INSERT INTO SystemSettings VALUES(DEFAULT, 'EnableEmailLog', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsLogs', 'la_config_EnableEmailLog', 'radio', NULL, '1=la_Yes||0=la_No', 65.01, 0, 1, 'hint:la_config_EnableEmailLog'); UPDATE SystemSettings SET DisplayOrder = 65.02, Heading = 'la_section_SettingsLogs', ValueList = '86400=la_opt_OneDay||604800=la_opt_OneWeek||1209600=la_opt_TwoWeeks||2419200=la_opt_OneMonth||7257600=la_opt_ThreeMonths||29030400=la_opt_OneYear||-1=la_opt_EmailLogKeepForever' WHERE VariableName = 'EmailLogRotationInterval'; UPDATE LanguageLabels SET l<%PRIMARY_LANGUAGE%>_Translation = 'Keep "E-mail Log" for', l<%PRIMARY_LANGUAGE%>_HintTranslation = 'This setting allows you to control for how long "E-mail Log" messages will be stored in the log and then automatically deleted. Use option "Forever" with caution since it will completely disable automatic log cleanup and can lead to large size of database table that stores e-mail messages.' WHERE PhraseKey = 'LA_CONFIG_EMAILLOGROTATIONINTERVAL' AND l<%PRIMARY_LANGUAGE%>_Translation = 'Keep Email Log for'; DELETE FROM LanguageLabels WHERE PhraseKey = 'LA_OPT_EMAILLOGKEEPNEVER'; INSERT INTO SystemSettings VALUES(DEFAULT, 'SystemLogRotationInterval', '2419200', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsLogs', 'la_config_SystemLogRotationInterval', 'select', NULL, '86400=la_opt_OneDay||604800=la_opt_OneWeek||1209600=la_opt_TwoWeeks||2419200=la_opt_OneMonth||7257600=la_opt_ThreeMonths||29030400=la_opt_OneYear||-1=la_opt_SystemLogKeepForever', 65.03, 0, 1, 'hint:la_config_SystemLogRotationInterval'); INSERT INTO SystemSettings VALUES(DEFAULT, 'SystemLogNotificationEmail', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsLogs', 'la_config_SystemLogNotificationEmail', 'text', 'a:5:{s:4:"type";s:6:"string";s:9:"formatter";s:10:"kFormatter";s:6:"regexp";s:85:"/^([-a-zA-Z0-9!\\#$%&*+\\/=?^_`{|}~.]+@[a-zA-Z0-9]{1}[-.a-zA-Z0-9_]*\\.[a-zA-Z]{2,6})$/i";s:10:"error_msgs";a:1:{s:14:"invalid_format";s:18:"!la_invalid_email!";}s:7:"default";s:0:"";}', NULL, 65.04, 0, 1, 'hint:la_config_SystemLogNotificationEmail'); INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'SYSTEM.LOG.NOTIFY', NULL, 1, 0, 'Core', 'Notification about message added to System Log', 1, 1, 1); ALTER TABLE Users ADD PasswordHashingMethod TINYINT NOT NULL DEFAULT '3' AFTER Password; UPDATE Users SET PasswordHashingMethod = 1; INSERT INTO SystemSettings VALUES(DEFAULT, 'TypeKitId', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_Settings3rdPartyAPI', 'la_config_TypeKitId', 'text', NULL, NULL, 80.05, 0, 1, NULL); ALTER TABLE MailingLists CHANGE EmailsQueued EmailsQueuedTotal INT(10) UNSIGNED NOT NULL DEFAULT '0'; RENAME TABLE <%TABLE_PREFIX%>EmailEvents TO <%TABLE_PREFIX%>EmailTemplates; ALTER TABLE EmailTemplates CHANGE `Event` TemplateName VARCHAR(40) NOT NULL DEFAULT ''; ALTER TABLE EmailTemplates CHANGE EventId TemplateId INT(11) NOT NULL AUTO_INCREMENT; ALTER TABLE SystemEventSubscriptions CHANGE EmailEventId EmailTemplateId INT(11) NULL DEFAULT NULL; DELETE FROM LanguageLabels WHERE PhraseKey IN ( 'LA_FLD_EXPORTEMAILEVENTS', 'LA_FLD_EVENT', 'LA_TITLE_EMAILMESSAGES', 'LA_TAB_E-MAILS', 'LA_COL_EMAILEVENTS', 'LA_OPT_EMAILEVENTS', 'LA_FLD_EMAILEVENT', 'LA_TITLE_EMAILEVENTS', 'LA_TITLE_ADDING_E-MAIL', 'LA_TITLE_EDITING_E-MAIL', 'LA_TITLE_EDITINGEMAILEVENT', 'LA_TITLE_NEWEMAILEVENT', 'LA_TAB_EMAILEVENTS' ); DELETE FROM UserPersistentSessionData WHERE VariableName IN ('system-event-subscription[Default]columns_.', 'email-log[Default]columns_.'); ALTER TABLE EmailLog CHANGE EventName TemplateName VARCHAR(255) NOT NULL DEFAULT ''; # ===== v 5.2.1-B2 ===== DELETE FROM LanguageLabels WHERE PhraseKey = 'LA_TAB_REPORTS'; ALTER TABLE Modules ADD ClassNamespace VARCHAR(255) NOT NULL DEFAULT '' AFTER Path; UPDATE Modules SET ClassNamespace = 'Intechnic\\InPortal\\Core' WHERE `Name` IN ('Core', 'In-Portal'); UPDATE SystemSettings SET DisplayOrder = DisplayOrder + 0.01 WHERE ModuleOwner = 'In-Portal' AND Section = 'in-portal:configure_categories' AND DisplayOrder > 10.10 AND DisplayOrder < 20; INSERT INTO SystemSettings VALUES(DEFAULT, 'CheckViewPermissionsInCatalog', '1', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_config_CheckViewPermissionsInCatalog', 'radio', NULL, '1=la_Yes||0=la_No', 10.11, 0, 1, 'hint:la_config_CheckViewPermissionsInCatalog'); # ===== v 5.2.1-RC1 ===== UPDATE LanguageLabels SET l1_Translation = REPLACE(l1_Translation, '
', '\n') WHERE PhraseKey = 'LA_EDITINGINPROGRESS'; UPDATE LanguageLabels SET l1_ColumnTranslation = 'Helpful' WHERE PhraseKey = 'LA_FLD_HELPFULCOUNT'; UPDATE LanguageLabels SET l1_ColumnTranslation = 'Not Helpful' WHERE PhraseKey = 'LA_FLD_NOTHELPFULCOUNT'; UPDATE LanguageLabels SET Module = 'Core' WHERE PhraseKey = 'LA_SECTION_FILE'; # ===== v 5.2.1 ===== # ===== v 5.2.2-B1 ===== UPDATE LanguageLabels SET l1_Translation = 'Incorrect data format, please use {type}' WHERE PhraseKey = 'LA_ERR_BAD_TYPE'; UPDATE LanguageLabels SET l1_Translation = 'Field value is out of range, possible values from {min_value} to {max_value}' WHERE PhraseKey = 'LA_ERR_VALUE_OUT_OF_RANGE'; UPDATE LanguageLabels SET l1_Translation = 'Field value length is out of range, possible value length from {min_length} to {max_length}' WHERE PhraseKey = 'LA_ERR_LENGTH_OUT_OF_RANGE'; ALTER TABLE Themes ADD StylesheetFile VARCHAR( 255 ) NOT NULL DEFAULT ''; UPDATE Themes SET StylesheetFile = 'platform/inc/styles.css' WHERE `Name` = 'advanced'; UPDATE EmailTemplates SET l1_Subject = REPLACE(l1_Subject, "Field name='Username'", 'UserTitle'), l1_HtmlBody = REPLACE(l1_HtmlBody, "Field name='Username'", 'UserTitle') WHERE TemplateName LIKE 'USER%'; UPDATE EmailTemplates SET l1_Subject = REPLACE(l1_Subject, 'Field name="Username"', 'UserTitle'), l1_HtmlBody = REPLACE(l1_HtmlBody, 'Field name="Username"', 'UserTitle') WHERE TemplateName LIKE 'USER%'; UPDATE SystemSettings SET VariableValue = 1 WHERE VariableName = 'CSVExportEncoding'; ALTER TABLE Semaphores ADD MainIDs INT NULL DEFAULT NULL AFTER MainPrefix; +# ===== v 5.2.2-B2 ===== +UPDATE Modules +SET ClassNamespace = 'InPortal\\Core' +WHERE `Name` IN ('Core', 'In-Portal'); + # ===== v 5.3.0-B1 ===== ALTER TABLE ScheduledTasks ADD Settings TEXT NULL; ALTER TABLE Themes ADD ImageResizeRules TEXT NULL; DELETE FROM UserPersistentSessionData WHERE VariableName = 'emailevents[Emails]columns_.'; INSERT INTO SystemCache (VarName, Data) SELECT 'tmp_translation' AS VarName, l<%PRIMARY_LANGUAGE%>_Translation AS Data FROM <%TABLE_PREFIX%>LanguageLabels WHERE PhraseKey = 'LC_IMPORTLANG_PHRASEWARNING'; UPDATE LanguageLabels SET Phrase = 'la_fld_ImportOverwrite', PhraseKey = 'LA_FLD_IMPORTOVERWRITE', l<%PRIMARY_LANGUAGE%>_HintTranslation = (SELECT Data FROM <%TABLE_PREFIX%>SystemCache WHERE VarName = 'tmp_translation' LIMIT 1) WHERE PhraseKey = 'LA_PROMPT_OVERWRITEPHRASES'; DELETE FROM LanguageLabels WHERE PhraseKey = 'LC_IMPORTLANG_PHRASEWARNING'; DELETE FROM LanguageLabels WHERE PhraseKey = 'LA_CONFIG_USETEMPLATECOMPRESSION'; DELETE FROM SystemSettings WHERE VariableName = 'UseTemplateCompression'; UPDATE SystemSettings SET DisplayOrder = ROUND(DisplayOrder - 0.01, 2) WHERE (DisplayOrder BETWEEN 60.04 AND 60.10) AND (ModuleOwner = 'In-Portal') AND (Section = 'in-portal:configure_advanced'); INSERT INTO SystemSettings VALUES(DEFAULT, 'RandomString', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_RandomString', 'text', '', '', 60.09, 0, 1, NULL); INSERT INTO SystemSettings VALUES(DEFAULT, 'PlainTextCookies', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_PlainTextCookies', 'text', '', '', 60.10, 0, 1, NULL); INSERT INTO SystemSettings VALUES(DEFAULT, 'ForceCanonicalUrls', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ForceCanonicalUrls', 'checkbox', '', '', 10.0125, 0, 0, NULL); UPDATE LanguageLabels SET l1_HintTranslation = '
    \r\n
  • This deploy script will apply all Database Changes stored in [module]/project_upgrades.sql to the current website and save applied Revisions in AppliedDBRevisions.
  • \r\n
  • This deploy script will create all new language phrases by re-importing [module]/install/english.lang file.
  • \r\n
  • This deploy script will reset all caches at once.
  • \r\n
' WHERE Phrase = 'la_title_SystemToolsDeploy'; INSERT INTO SystemSettings VALUES(DEFAULT, 'EmailDelivery', '2', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_config_EmailDelivery', 'radio', NULL, '1=la_opt_EmailDeliveryQueue||2=la_opt_EmailDeliveryImmediate', 50.11, 0, 1, NULL); DELETE FROM UserPersistentSessionData WHERE VariableName = 'email-queue[Default]columns_.'; ALTER TABLE EmailLog ADD ToUserId INT(11) DEFAULT NULL, ADD ItemPrefix VARCHAR(50) NOT NULL DEFAULT '', ADD ItemId INT(11) DEFAULT NULL; DELETE FROM UserPersistentSessionData WHERE VariableName = 'email-log[Default]columns_.'; ALTER TABLE EmailLog ADD Status TINYINT NOT NULL DEFAULT '1' AFTER TextBody, ADD ErrorMessage VARCHAR(255) NOT NULL DEFAULT '' AFTER Status; ALTER TABLE ScheduledTasks ADD Module varchar(30) NOT NULL DEFAULT 'Core'; CREATE TABLE ModuleDeploymentLog ( Id int(11) NOT NULL AUTO_INCREMENT, Module varchar(30) NOT NULL DEFAULT 'In-Portal', RevisionNumber int(11) NOT NULL DEFAULT '0', RevisionTitle varchar(255) NOT NULL DEFAULT '', CreatedOn int(10) unsigned DEFAULT NULL, IPAddress varchar(15) NOT NULL DEFAULT '', Output text, ErrorMessage varchar(255) NOT NULL DEFAULT '', Mode tinyint(1) NOT NULL DEFAULT '1', Status tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (Id), KEY CreatedOn (CreatedOn), KEY Mode (Mode), KEY Status (Status) ); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:module_deployment_log.view', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:module_deployment_log.edit', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:module_deployment_log.delete', 11, 1, 1, 0); UPDATE EmailTemplates SET l<%PRIMARY_LANGUAGE%>_Subject = REPLACE(l<%PRIMARY_LANGUAGE%>_Subject, '', ''), l<%PRIMARY_LANGUAGE%>_PlainTextBody = REPLACE(l<%PRIMARY_LANGUAGE%>_PlainTextBody, '', ''), l<%PRIMARY_LANGUAGE%>_HtmlBody = REPLACE(l<%PRIMARY_LANGUAGE%>_HtmlBody, '', '') WHERE TemplateName IN ('USER.SUBSCRIBE', 'USER.UNSUBSCRIBE'); ALTER TABLE CategoryItems ADD Id int(11) NOT NULL auto_increment FIRST, ADD PRIMARY KEY (Id); ALTER TABLE UserGroupRelations DROP PRIMARY KEY; ALTER TABLE UserGroupRelations ADD Id int(11) NOT NULL auto_increment FIRST, ADD PRIMARY KEY (Id), ADD UNIQUE KEY UserGroup (PortalUserId, GroupId); DELETE FROM UserPersistentSessionData WHERE VariableName IN ('u-ug[Default]columns_.', 'g-ug[Default]columns_.'); ALTER TABLE SpamControl ADD Id int(11) NOT NULL auto_increment FIRST, ADD PRIMARY KEY (Id); INSERT INTO SystemSettings VALUES(DEFAULT, 'SSLDomain', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSSL', 'la_config_SSLDomain', 'text', '', '', 30.01, 0, 1, NULL); INSERT INTO SystemSettings VALUES(DEFAULT, 'AdminSSLDomain', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSSL', 'la_config_AdminSSLDomain', 'text', '', '', 30.02, 0, 0, NULL); DELETE FROM LanguageLabels WHERE PhraseKey IN ('LA_CONFIG_SSL_URL', 'LA_CONFIG_ADMINSSL_URL', 'LA_FLD_SSLURL'); ALTER TABLE SiteDomains CHANGE SSLUrl SSLDomainName VARCHAR(255) NOT NULL DEFAULT '', CHANGE SSLUrlUsesRegExp SSLDomainNameUsesRegExp TINYINT(4) NOT NULL DEFAULT '0'; DELETE FROM UserPersistentSessionData WHERE VariableName = 'site-domain[Default]columns_.'; -UPDATE Modules -SET ClassNamespace = 'InPortal\\Core' -WHERE `Name` IN ('Core', 'In-Portal'); +# Backported in http://jira.in-portal.org/browse/INP-1690. +# UPDATE Modules +# SET ClassNamespace = 'InPortal\\Core' +# WHERE `Name` IN ('Core', 'In-Portal'); UPDATE EmailTemplates SET l1_Subject = REPLACE(l1_Subject, '