- Timestamp:
- 06/25/11 11:27:27 (11 months ago)
- Location:
- trunk/gui
- Files:
-
- 5 added
- 1 deleted
- 18 edited
- 1 moved
-
admin/settings_ports.php (modified) (1 diff)
-
client/dns_edit.php (modified) (1 diff)
-
client/language.php (modified) (2 diffs)
-
client/mail_accounts.php (modified) (5 diffs)
-
client/protected_areas_add.php (modified) (1 diff)
-
client/protected_user_assign.php (modified) (1 diff)
-
include/Net (moved) (moved from trunk/gui/include/Net_DNS)
-
include/Net/IDNA2 (added)
-
include/Net/IDNA2.php (added)
-
include/Net/IDNA2/Exception (added)
-
include/Net/IDNA2/Exception.php (added)
-
include/Net/IDNA2/Exception/Nameprep.php (added)
-
include/admin-functions.php (modified) (5 diffs)
-
include/functions.ticket_system.php (modified) (1 diff)
-
include/ispCP/Database/ResultSet.php (modified) (5 diffs)
-
include/ispCP/Exception/Writer/Browser.php (modified) (1 diff)
-
include/ispCP/Initializer.php (modified) (5 diffs)
-
include/ispCP/Update.php (modified) (1 diff)
-
include/ispcp-functions.php (modified) (4 diffs)
-
include/ispcp-lib.php (modified) (1 diff)
-
include/login-functions.php (modified) (2 diffs)
-
include/net_idna (deleted)
-
lostpassword.php (modified) (1 diff)
-
orderpanel/package_info.php (modified) (1 diff)
-
reseller/language.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/admin/settings_ports.php
r3846 r3871 320 320 * @since 1.0.7 321 321 * @author Laurent declercq (nuxwin) <laurent.declercq@ispcp.net> 322 * @param ispCP_TemplateEngine $tpl Reference to a pTemplate instance322 * @param ispCP_TemplateEngine $tpl Reference to a template instance 323 323 * @return void; 324 324 */ -
trunk/gui/client/dns_edit.php
r3846 r3871 27 27 28 28 require_once '../include/ispcp-lib.php'; 29 require_once '../include/Net _DNS/DNS.php';29 require_once '../include/Net/DNS/DNS.php'; 30 30 31 31 check_login(__FILE__); -
trunk/gui/client/language.php
r3868 r3871 40 40 if (isset($_POST['uaction']) && $_POST['uaction'] === 'save_lang') { 41 41 $user_id = $_SESSION['user_id']; 42 $user_lang = $_POST['def_language'];42 $user_lang = clean_input($_POST['def_language']); 43 43 $query = " 44 44 UPDATE … … 51 51 52 52 exec_query($sql, $query, array($user_lang, $user_id)); 53 unset($_SESSION['user_def_lang']); 54 $_SESSION['user_def_lang'] = $user_lang; 53 54 if(!isset($_SESSION['logged_from_id'])) { 55 unset($_SESSION['user_def_lang']); 56 $_SESSION['user_def_lang'] = $user_lang; 57 } 58 55 59 set_page_message(tr('User language updated successfully!'), 'success'); 56 60 } -
trunk/gui/client/mail_accounts.php
r3852 r3871 106 106 * Must be documented 107 107 * 108 * @param ispCP_TemplateEngine $tpl pTemplate instance108 * @param ispCP_TemplateEngine $tpl template instance 109 109 * @param int $mail_id 110 110 * @param string $mail_type … … 165 165 * Must be documented 166 166 * 167 * @param ispCP_TemplateEngine $tpl reference to pTemplate object167 * @param ispCP_TemplateEngine $tpl reference to template object 168 168 * @param ispCP_Database $sql reference to ispcp_Database object 169 169 * @param int $dmn_id domain name id … … 376 376 * Must be documented 377 377 * 378 * @param ispCP_TemplateEngine $tpl reference to the pTemplate object378 * @param ispCP_TemplateEngine $tpl reference to the template object 379 379 * @param ispCP_Database $sql reference to the ispCP_Database object 380 380 * @param int $dmn_id domain name id … … 486 486 * Must be documented 487 487 * 488 * @param ispCP_TemplateEngine $tpl reference to pTemplate object488 * @param ispCP_TemplateEngine $tpl reference to template object 489 489 * @param ispCP_Database $sql reference to the ispCP_Database object 490 490 * @param int $dmn_id domain name id; … … 593 593 * Must be documented 594 594 * 595 * @param ispCP_TemplateEngine $tpl Reference to the pTemplate object595 * @param ispCP_TemplateEngine $tpl Reference to the template object 596 596 * @param ispCP_Database $sql Reference to the ispCP_Database object 597 597 * @param int $user_id Customer id -
trunk/gui/client/protected_areas_add.php
r3846 r3871 209 209 210 210 /** 211 * @param ispCP_ pTemplate $tpl211 * @param ispCP_TemplateEngine $tpl 212 212 * @param ispCP_Database $sql 213 213 * @param int $dmn_id -
trunk/gui/client/protected_user_assign.php
r3846 r3871 72 72 73 73 /** 74 * @param ispCP_ pTemplate $tpl74 * @param ispCP_TemplateEngine $tpl 75 75 * @param ispCP_Database $sql 76 76 * @param int $dmn_id -
trunk/gui/include/admin-functions.php
r3841 r3871 342 342 343 343 /** 344 * @param ispCP_ pTemplate $tpl344 * @param ispCP_TemplateEngine $tpl 345 345 * @param ispCP_Database $sql 346 346 * @return void … … 439 439 440 440 /** 441 * @param ispCP_ pTemplate $tpl441 * @param ispCP_TemplateEngine $tpl 442 442 * @param ispCP_Database $sql 443 443 */ … … 531 531 532 532 /** 533 * @param ispCP_ pTemplate $tpl533 * @param ispCP_TemplateEngine $tpl 534 534 * @param ispCP_Database $sql 535 535 */ … … 786 786 787 787 /** 788 * @param ispCP_ pTemplate $tpl788 * @param ispCP_TemplateEngine $tpl 789 789 * @param ispCP_Database $sql 790 790 */ … … 2436 2436 * @todo use template(s) instead of hardcoded (X)HTML 2437 2437 * @todo possible SESSION hijackin for $_SESSION['user_theme'] 2438 * @param ispCP_ pTemplate $tpl2438 * @param ispCP_TemplateEngine $tpl 2439 2439 * @param ispCP_Database $sql 2440 2440 * @param int $user_id -
trunk/gui/include/functions.ticket_system.php
r3841 r3871 167 167 168 168 if ($userLevel < 1 || $userLevel > 2) 169 throw new ispCP_Exception(" ERROR:User level is not valid!");169 throw new ispCP_Exception("User level is not valid!"); 170 170 171 171 $ticket_date = time(); -
trunk/gui/include/ispCP/Database/ResultSet.php
r3762 r3871 77 77 if(!($stmt instanceof PDOStatement)) { 78 78 throw new ispCP_Exception_Database( 79 ' Error:Argument passed to ' . __METHOD__ . '() must be a ' .79 'Argument passed to ' . __METHOD__ . '() must be a ' . 80 80 'PDOStatement object!' 81 81 ); … … 86 86 87 87 /** 88 * P hpoverloading89 * 90 * P hpoverloading method that allows to fetch the first row in the result88 * PHP overloading 89 * 90 * PHP overloading method that allows to fetch the first row in the result 91 91 * set or check if one row exist in the result set 92 92 * … … 115 115 } 116 116 117 throw new ispCP_Exception_Database(" Error:Unknown parameter: `$param`");117 throw new ispCP_Exception_Database("Unknown parameter: `$param`"); 118 118 } 119 119 … … 184 184 * how the row is returned. 185 185 * 186 * @param int $fetchStyle 186 * @param int $fetchStyle Controls how the next row will be returned to the 187 * caller. This value must be one of the PDO::FETCH_* constants 187 188 * @return mixed The return value of this function on success depends on the 188 189 * fetch style. In all cases, FALSE is returned on failure. … … 197 198 198 199 /** 200 * Fetches all rows from the current result set 201 * 202 * Fetches all rows from the result set. The fetch_style parameter 203 * determines how the rows are returned. 204 * 205 * @param int $fetchStyle Controls how the next row will be returned to the 206 * caller. This value must be one of the PDO::FETCH_* constants 207 * @return mixed The return value of this function on success depends on the 208 * fetch style. In all cases, FALSE is returned on failure. 209 * @todo Finish fetch style implementation 210 */ 211 public function fetchAll($fetchStyle = null) { 212 213 $fetchStyle = is_null($fetchStyle) ? $this->_fetchMode : $fetchStyle; 214 215 return $this->_stmt->fetchAll($fetchStyle); 216 } 217 218 /** 199 219 * Fetches the next row from the current result set 200 220 * -
trunk/gui/include/ispCP/Exception/Writer/Browser.php
r3825 r3871 44 44 * 45 45 * The given template should be a template file that can be treated by a 46 * pTemplate object.46 * template object. 47 47 * 48 48 * <b>Note:</b> Will be improved later. -
trunk/gui/include/ispCP/Initializer.php
r3857 r3871 39 39 * @author Laurent declercq <laurent.declercq@ispcp.net> 40 40 * @since 1.0.7 41 * @version 1.1. 241 * @version 1.1.3 42 42 */ 43 43 class ispCP_Initializer { … … 158 158 $this->_setIncludePath(); 159 159 160 // Create or restore the session161 $this->_initializeSession();162 163 160 // Establish the connection to the database 164 161 $this->_initializeDatabase(); … … 176 173 // Initialize output buffering 177 174 $this->_initializeOutputBuffering(); 175 176 // Create or restore the session 177 $this->_initializeSession(); 178 178 179 179 // Initialize internationalization libraries … … 354 354 */ 355 355 protected function _initializeSession() { 356 357 if (!is_writable($this->_config->GUI_ROOT_DIR . '/phptmp')) { 358 throw new ispCP_Exception('The directory '. $this->_config->GUI_ROOT_DIR . '/phptmp must be writable.'); 359 } 356 360 357 361 session_name('ispCP'); … … 558 562 * execution context are loaded. 559 563 * 560 * <b>Note:</b> Not used at this moment (testing in progress...)564 * <b>Note:</b> Not used at this moment 561 565 * 562 566 * @return void -
trunk/gui/include/ispCP/Update.php
r3762 r3871 198 198 $sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 199 199 200 // Checks if a database updated previously failed 200 201 if(isset($dbConfig->FAILED_UPDATE)) { 201 202 list($failedUpdate, $queryNb) = $dbConfig->FAILED_UPDATE; 202 203 } else { 203 204 $failedUpdate = 'inexistent'; 205 $queryNb = -1; 204 206 } 205 207 206 try { 207 208 // We execute all SQL statements 209 foreach($queryArray as $index => $query) { 210 // Query was already applied with success ? 211 if($functionName == $failedUpdate && $index < $queryNb) { 212 continue; 208 // We execute all SQL statements 209 foreach($queryArray as $index => $query) { 210 211 // Query was already applied with success ? 212 if ($functionName == $failedUpdate && $index < $queryNb) { 213 continue; 214 } 215 216 try { 217 $sql->query($query); 218 unset($dbConfig->FAILED_UPDATE); 219 220 // Update revision 221 $dbConfig->set($this->_databaseVariableName, $newVersion); 222 223 } catch (PDOException $e) { 224 225 // Store the query number and function name that wraps it 226 $dbConfig->FAILED_UPDATE = "$functionName;$index"; 227 228 // Prepare error message 229 $errorMessage = sprintf($this->_errorMessage, $newVersion); 230 231 // Extended error message 232 if(PHP_SAPI != 'cli') { 233 $errorMessage .= ':<br /><br />' . $e->getMessage() . 234 '<br /><br />Query: ' . trim($query); 235 } else { 236 $errorMessage .= ":\n\n" . $e->getMessage() . 237 "\nQuery: " . trim($query); 213 238 } 214 239 215 $sql->query($query); 240 $this->_addErrorMessage($errorMessage); 241 242 // An error occurred, we stop here ! 243 return false; 216 244 } 217 218 unset($dbConfig->FAILED_UPDATE);219 220 // Update revision221 $dbConfig->set($this->_databaseVariableName, $newVersion);222 223 } catch (PDOException $e) {224 225 // Store the query number and function name that wraps it226 $dbConfig->FAILED_UPDATE = "$functionName;$index";227 228 // Prepare error message229 $errorMessage = sprintf($this->_errorMessage, $newVersion);230 231 // Extended error message232 if(PHP_SAPI != 'cli') {233 $errorMessage .= ':<br /><br />' . $e->getMessage() .234 '<br /><br />Query: ' . trim($query);235 } else {236 $errorMessage .= ":\n\n" . $e->getMessage() .237 "\nQuery: " . trim($query);238 }239 240 $this->_addErrorMessage($errorMessage);241 242 // An error occurred, we stop here !243 return false;244 245 } 245 246 -
trunk/gui/include/ispcp-functions.php
r3762 r3871 389 389 390 390 /** 391 * Should be documented391 * Decodes a String from IDNA format to UTF8 392 392 * 393 393 * @param $input … … 398 398 if (function_exists('idn_to_unicode')) { 399 399 return idn_to_utf8($input, IDNA_USE_STD3_RULES); 400 } 401 402 $IDN = new idna_convert(); 403 $output = $IDN->decode($input); 404 405 return ($output == false) ? $input : $output; 406 } 407 408 /** 409 * Should be documented 400 } else { 401 402 $IDNA = new Net_IDNA2(); 403 $output = $IDNA->decode($input); 404 405 return ($output == false) ? $input : $output; 406 } 407 } 408 409 /** 410 * Encodes a String from IDNA format ASCII 410 411 * 411 412 * @param $input … … 416 417 if (function_exists('idn_to_ascii')) { 417 418 return idn_to_ascii($input); 418 } 419 420 $IDN = new idna_convert(); 421 $output = $IDN->encode($input); 422 423 return $output; 424 } 425 426 /** 427 * Should be documented 419 } else { 420 421 $IDNA = new Net_IDNA2(); 422 $output = $IDNA->encode($input); 423 424 return $output; 425 } 426 } 427 428 /** 429 * Check wether a given String is a number or not. 428 430 * 429 431 * @param $integer Number to be checked … … 431 433 */ 432 434 function is_number($number) { 433 434 435 return (bool) preg_match('/^[0-9]+$/D', $number); 435 436 } -
trunk/gui/include/ispcp-lib.php
r3775 r3871 100 100 * Include ispCP common functions 101 101 */ 102 require_once ' net_idna/idna_convert.class.php';102 require_once 'Net/IDNA2.php'; 103 103 require_once INCLUDEPATH . '/ispcp-functions.php'; 104 104 -
trunk/gui/include/login-functions.php
r3762 r3871 365 365 366 366 deny_access(); 367 return true;367 return; 368 368 } 369 369 … … 571 571 572 572 deny_access(); 573 return; 573 574 } 574 575 -
trunk/gui/lostpassword.php
r3775 r3871 41 41 // check if GD library is available 42 42 if (!check_gd()) { 43 throw new ispCP_Exception(tr(" ERROR: php-extension 'gd' not loaded!"));43 throw new ispCP_Exception(tr("PHP Extension 'gd' not loaded!")); 44 44 } 45 45 46 46 // check if captch fonts exist 47 47 if (!captcha_fontfile_exists()) { 48 throw new ispCP_Exception(tr(" ERROR: captcha fontfile not found!"));48 throw new ispCP_Exception(tr("Captcha fontfile not found!")); 49 49 } 50 50 -
trunk/gui/orderpanel/package_info.php
r3841 r3871 63 63 64 64 /** 65 * @param ispCP_ pTemplate $tpl65 * @param ispCP_TemplateEngine $tpl 66 66 * @param ispCP_Database $sql 67 67 * @param int $user_id -
trunk/gui/reseller/language.php
r3868 r3871 47 47 $user_id = $_SESSION['user_id']; 48 48 49 $user_lang = $_POST['def_language'];49 $user_lang = clean_input($_POST['def_language']); 50 50 51 51 $query = " … … 60 60 exec_query($sql, $query, array($user_lang, $user_id)); 61 61 62 unset($_SESSION['user_def_lang']); 63 $_SESSION['user_def_lang'] = $user_lang; 62 if(!isset($_SESSION['logged_from_id'])) { 63 unset($_SESSION['user_def_lang']); 64 $_SESSION['user_def_lang'] = $user_lang; 65 } 64 66 set_page_message(tr('User language updated successfully!'), 'success'); 65 67 }
Note: See TracChangeset
for help on using the changeset viewer.
