Changeset 968
- Timestamp:
- 11/03/2007 05:11:03 AM (13 months ago)
- Location:
- trunk/system
- Files:
-
- 7 modified
-
config/log.php (modified) (2 diffs)
-
config/pagination.php (modified) (1 diff)
-
core/Log.php (modified) (3 diffs)
-
libraries/Auth.php (modified) (1 diff)
-
libraries/Pagination.php (modified) (5 diffs)
-
libraries/drivers/Database_Mysql.php (modified) (1 diff)
-
libraries/drivers/Database_Pgsql.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/config/log.php
r866 r968 14 14 * 2 - Debug Messages 15 15 * 3 - Informational Messages 16 * 4 - All Messages17 16 * 18 17 * Options: 19 * threshold - Message threshold18 * threshold - Cascading message threshold 20 19 * directory - Log file directory, relative to application/, or absolute 21 20 * format - PHP date format for timestamps, see: http://php.net/date … … 27 26 $config = array 28 27 ( 29 'threshold' => 4,28 'threshold' => 1, 30 29 'directory' => 'logs', 31 30 'format' => 'Y-m-d H:i:s' -
trunk/system/config/pagination.php
r866 r968 4 4 * 5 5 * Options: 6 * style - Style name 6 * directory - Views folder in which your pagination style templates reside 7 * style - Style name (matches template filename) 8 * uri_segment - URI segment (or 'label') in which the current page number can be found 7 9 * items_per_page - Number of items in a page of results 8 10 */ 9 11 $config = array 10 12 ( 13 'directory' => 'pagination', 11 14 'style' => 'classic', 15 'uri_segment' => 3, 12 16 'items_per_page' => 20 13 17 ); -
trunk/system/core/Log.php
r957 r968 11 11 final class Log { 12 12 13 private static $types = array(1 => 'error', 2 => 'debug', 3 => 'info'); 13 14 private static $messages = array(); 14 15 … … 23 24 public static function add($type, $message) 24 25 { 25 self::$messages[ $type][] = array26 self::$messages[strtolower($type)][] = array 26 27 ( 27 28 date(Config::item('log.format')), … … 63 64 foreach(self::$messages as $type => $data) 64 65 { 66 if (array_search($type, self::$types) > $threshold) 67 continue; 68 65 69 foreach($data as $date => $text) 66 70 { 67 71 list($date, $message) = $text; 68 $messages .= $date.' -- -'.$type.': '.$message."\r\n";72 $messages .= $date.' -- '.$type.': '.$message."\r\n"; 69 73 } 70 74 } -
trunk/system/libraries/Auth.php
r958 r968 44 44 'username' => $username, 45 45 'password' => sha1($password), 46 'level >=' => $level46 'level >=' => (int) $level 47 47 )) 48 48 ->limit(1) 49 49 ->get(); 50 50 51 if (count($result) === 1) 52 { 53 // Get the first result 54 $result = $result->offsetGet(0); 51 if (count($result) !== 1) 52 return FALSE; 55 53 56 // Update the number of logins57 $this->db58 ->set('logins', ($result->logins + 1)) 59 ->where('id', $result->id)60 ->update($this->users_table);61 62 // Store session data63 $this->session->set(array64 ( 65 'user_id' => $result->id,66 'username' => $username,67 'level' => $result->level68 ));69 70 return TRUE;71 }72 73 return FALSE;54 // Get the first result 55 $result = $result->offsetGet(0); 56 57 // Update the number of logins 58 $this->db 59 ->set('logins', ($result->logins + 1)) 60 ->where('id', (int) $result->id) 61 ->update($this->users_table); 62 63 // Store session data 64 $this->session->set(array 65 ( 66 'user_id' => (int) $result->id, 67 'username' => $username, 68 'level' => (int) $result->level 69 )); 70 71 return TRUE; 74 72 } 75 73 -
trunk/system/libraries/Pagination.php
r932 r968 10 10 class Pagination_Core { 11 11 12 public $base_url = ''; 13 public $style = 'classic'; 14 public $uri_segment = 3; 15 public $items_per_page = 10; 12 public $base_url = ''; 13 public $directory = 'pagination'; 14 public $style = 'classic'; 15 public $uri_segment = 3; 16 public $items_per_page = 10; 16 17 17 18 public $current_page; … … 109 110 $style = (isset($style)) ? $style : $this->style; 110 111 111 return (string) new View( 'pagination/'.$style, get_object_vars($this));112 return (string) new View(trim($this->directory, '/').'/'.$style, get_object_vars($this)); 112 113 } 113 114 … … 119 120 /* 120 121 * Method: url 121 * Get the base_url with the specified page number.122 * Gets the base_url with the specified page number. 122 123 * 123 124 * Parameters: … … 136 137 /* 137 138 * Method: sql_offset 138 * Get the SQL offset of the first row to return.139 * Gets the SQL offset of the first row to return. 139 140 * 140 141 * Returns: … … 148 149 /* 149 150 * Method: url 150 * Generate the complete SQL LIMIT clause.151 * Generates the complete SQL LIMIT clause. 151 152 * 152 153 * Returns: -
trunk/system/libraries/drivers/Database_Mysql.php
r962 r968 161 161 public function escape_column($column) 162 162 { 163 if (strtolower($column) == 'count(*)' or$column == '*')163 if (strtolower($column) == 'count(*)' OR $column == '*') 164 164 return $column; 165 165 -
trunk/system/libraries/drivers/Database_Pgsql.php
r828 r968 120 120 { 121 121 122 $prefix = (($num_wheres > 0) or($count++ > 1)) ? $type : '';122 $prefix = (($num_wheres > 0) OR ($count++ > 1)) ? $type : ''; 123 123 124 124 if ($quote === -1)
