Changeset 632

Show
Ignore:
Timestamp:
06/01/07 18:37:34 (2 years ago)
Author:
rats
Message:

Fixed #333: Variables "{1}" in the Admin Log

Fixed #340: Logo upload not possible

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CHANGELOG

    r628 r632  
    1111\_________________________________________________________________/ 
    1212 
    13 2007-06-01 Henrik Schytte  
     132007-06-01 Henrik Schytte 
    1414        - GUI 
    1515                * Fixed #325: ispCP wasn't ready for small Screens (1024x768) 
    16                 * Fixed new Icons for the Filemanager, too ;)  
     16                * Fixed new Icons for the Filemanager, too ;) 
    1717 
    18182007-06-01 Benedikt Heintel 
    1919        - SETUP 
    2020                * fixed serveral install bugs 
     21        - GUI 
     22                * Fixed #333: Variables "{1}" in the Admin Log 
     23                * Fixed #340: Logo upload not possible 
    2124 
    22252007-05-31 Benedikt Heintel 
  • trunk/gui/admin/admin_log.php

    r613 r632  
    11<?php 
    22/** 
    3  *  ispCP (OMEGA) - Virtual Hosting Control System | Omega Version 
     3 *  ispCP (OMEGA) a Virtual Hosting Control System 
    44 * 
    55 *  @copyright  2001-2006 by moleSoftware GmbH 
     
    172172           $log_message = $rs->fields['log_message']; 
    173173           $replaces = array( 
    174                '/[^a-zA-Z](delete)[^a-zA-Z]/i' => '<font color="#FF0000"><strong>\\{1}</strong></font>', 
    175                '/[^a-zA-Z](add)[^a-zA-Z]/i'    => '<font color="#CC6600"><strong>\\{1}</strong></font>', 
    176                '/[^a-zA-Z](change)[^a-zA-Z]/i' => '<font color="#3300FF"><strong>\\{1}</strong></font>', 
    177                '/[^a-zA-Z](edit)[^a-zA-Z]/i'   => '<font color="#CC6600"><strong>\\{1}</strong></font>', 
    178                '/[^a-zA-Z](unknown)[^a-zA-Z]/i'=> '<font color="#CC00FF"><strong>\\{1}</strong></font>', 
    179                '/[^a-zA-Z](logged)[^a-zA-Z]/i' => '<font color="#339966"><strong>\\{1}</strong></font>', 
    180                '/(bad password login data)/i'  => '<font color="#FF0000"><strong>\\{1}</strong></font>' 
     174               '/[^a-zA-Z](delete)[^a-zA-Z]/i' => '<font color="#FF0000"><strong>\\1</strong></font>', 
     175               '/[^a-zA-Z](add)[^a-zA-Z]/i'    => '<font color="#CC6600"><strong>\\1</strong></font>', 
     176               '/[^a-zA-Z](change)[^a-zA-Z]/i' => '<font color="#3300FF"><strong>\\1</strong></font>', 
     177               '/[^a-zA-Z](edit)[^a-zA-Z]/i'   => '<font color="#CC6600"><strong>\\1</strong></font>', 
     178               '/[^a-zA-Z](unknown)[^a-zA-Z]/i'=> '<font color="#CC00FF"><strong>\\1</strong></font>', 
     179               '/[^a-zA-Z](logged)[^a-zA-Z]/i' => '<font color="#339966"><strong>\\1</strong></font>', 
     180               '/(bad password login data)/i'  => '<font color="#FF0000"><strong>\\1</strong></font>' 
    181181           ); 
    182182 
     
    209209 
    210210        switch ($_POST['uaction_clear']) { 
    211                  
    212                 case 0:  
     211 
     212                case 0: 
    213213                                $query = <<<SQL_QUERY 
    214214            delete 
     
    217217SQL_QUERY; 
    218218                        break; 
    219                          
     219 
    220220                case 2: 
    221221                        //2 Weeks 
    222                          
    223                                 $query = <<<SQL_QUERY 
    224             delete 
    225                 from 
    226             log 
    227                 where  
     222 
     223                                $query = <<<SQL_QUERY 
     224            delete 
     225                from 
     226            log 
     227                where 
    228228            DATE_SUB(CURDATE(), INTERVAL 14 DAY) 
    229                         >= log_time   
    230             
     229                        >= log_time 
     230 
    231231SQL_QUERY; 
    232232 
    233233                        break; 
    234                  
     234 
    235235                case 4: 
    236236                                $query = <<<SQL_QUERY 
     
    238238                from 
    239239            log 
    240                 where  
     240                where 
    241241            DATE_SUB(CURDATE(), INTERVAL 1 MONTH) 
    242                         >= log_time          
    243 SQL_QUERY; 
    244                          
     242                        >= log_time 
     243SQL_QUERY; 
     244 
    245245                        break; 
    246246                case 26: 
     
    249249                from 
    250250            log 
    251                 where  
     251                where 
    252252            DATE_SUB(CURDATE(), INTERVAL 6 MONTH) 
    253                         >= log_time          
     253                        >= log_time 
    254254SQL_QUERY; 
    255255                        break; 
    256                          
     256 
    257257                case 52; 
    258258                                $query = <<<SQL_QUERY 
     
    260260                from 
    261261            log 
    262                 where  
     262                where 
    263263            DATE_SUB(CURDATE(), INTERVAL 1 YEAR) 
    264                         >= log_time          
    265 SQL_QUERY; 
    266                  
     264                        >= log_time 
     265SQL_QUERY; 
     266 
    267267                        break; 
    268                                                                                          
     268 
    269269        } 
    270          
    271         $rs = exec_query($sql, $query, array());        
    272          
     270 
     271        $rs = exec_query($sql, $query, array()); 
     272 
    273273    } 
    274274} 
  • trunk/gui/admin/layout.php

    r606 r632  
    11<?php 
    22/** 
    3  *  ispCP (OMEGA) - Virtual Hosting Control System | Omega Version 
     3 *  ispCP (OMEGA) a Virtual Hosting Control System 
    44 * 
    55 *  @copyright  2001-2006 by moleSoftware GmbH 
     
    1818 **/ 
    1919 
    20 function save_layout(&$sql) 
    21 
     20include '../include/ispcp-lib.php'; 
     21 
     22check_login(); 
     23 
     24function save_layout(&$sql) { 
    2225 
    2326    if (isset($_POST['uaction']) && $_POST['uaction'] === 'save_layout') { 
     
    4346} 
    4447 
    45 function update_logo() 
    46 
     48function update_logo() { 
    4749    global $cfg; 
    4850 
     
    8587            } 
    8688 
    87             $fname = $_FILES['logo_file']['name']; 
     89            $fname = $_FILES['logo_file']['tmp_name']; 
    8890 
    8991            // Make sure it is really an image 
     
    9395            } 
    9496 
    95 //            $fsize = $_FILES['logo_file']['size']; 
     97                       // $fsize = $_FILES['logo_file']['size']; 
    9698 
    9799            $newFName = get_user_name($user_id) . '.' . $fext; 
     
    99101            $path1 = substr($_SERVER['SCRIPT_FILENAME'],0, strpos($_SERVER['SCRIPT_FILENAME'], '/admin/layout.php')+1); 
    100102 
    101 //            $path2 = substr($cfg['ROOT_TEMPLATE_PATH'],0, strpos($cfg['ROOT_TEMPLATE_PATH'], '/tpl')+1); 
     103                       // $path2 = substr($cfg['ROOT_TEMPLATE_PATH'],0, strpos($cfg['ROOT_TEMPLATE_PATH'], '/tpl')+1); 
    102104 
    103105            $logoFile = $path1 . '/themes/user_logos/' . $newFName; 
    104             move_uploaded_file($_FILES['logo_file']['tmp_name'], $logoFile); 
     106            move_uploaded_file($fname, $logoFile); 
    105107            chmod ($logoFile, 0644); 
    106108 
     
    112114} 
    113115 
    114 function update_user_gui_props($file_name, $user_id) 
    115 
     116function update_user_gui_props($file_name, $user_id) { 
    116117    global $sql; 
    117118 
     
    130131 
    131132 
    132 function gen_def_layout(&$tpl, $user_def_layout) 
    133 
     133// unused? can be deleted? 
     134/* 
     135function gen_def_layout(&$tpl, $user_def_layout) { 
    134136    $layouts = array('blue', 'green', 'red', 'yellow'); 
    135137 
     
    158160 
    159161} 
    160  
    161 include '../include/ispcp-lib.php'; 
    162  
    163 check_login(); 
     162*/ 
    164163 
    165164$tpl = new pTemplate(); 
     
    173172 
    174173 
    175  
    176  
    177  
    178174save_layout($sql); 
    179175 
    180176update_logo(); 
    181177 
    182 global $cfg; 
    183178$theme_color = $cfg['USER_INITIAL_THEME']; 
    184179