Changeset 1128

Show
Ignore:
Timestamp:
04/28/2008 10:55:21 PM (2 months ago)
Author:
rats
Message:

* Updated database files
* Fixed #1212: Syntax Error in edit_mail_acc.php

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CHANGELOG

    r1127 r1128  
    1212                * Fixed Awstats path for OpenSuSe 
    1313 
     142008-04-25 Benedikt Heintel 
     15        - DATABASE: 
     16                * Updated database files 
     17        - GUI: 
     18                * Fixed #1212: Syntax Error in edit_mail_acc.php 
     19 
    14202008-04-24 Jochen Manz 
    1521        - GUI: 
    1622                * Fixed #1205: webtools - small layout issue... 
    17                 * Fixed #1206: german languag error -> variable not replaced 
     23                * Fixed #1206: german language error -> variable not replaced 
    1824                * Enhanced the DB update functionality 
    1925 
     
    2329        - ENGINE: 
    2430                * Fixed #1148: DNS serial is not updated more than once a day when changing sub domains 
     31                * Fixed #1169: Awstats on Opensuse 
    2532                * Fixed #1196: New mail account/forward and auto responder handling 
    2633 
  • trunk/configs/centos/cron.d/parts/dmn_awstats_entry.tpl

    r994 r1128  
    1 {MINUTE} {HOUR}  * * *   root perl /var/www/ispcp/engine/awstats/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang=en -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir=/var/www/virtual/{DMN_NAME}/statistics/ >/dev/null 2>&1 
     1{MINUTE} {HOUR}  * * *   root perl {AWSTATS_ROOT_DIR}/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang={USER_LANG} -awstatsprog={AWSTATS_ENGINE_DIR}/awstats.pl -dir={APACHE_WWW_DIR}/{DMN_NAME}/statistics/ >/dev/null 2>&1 
  • trunk/configs/centos/database/database.sql

    r1088 r1128  
    341341  `mail_forward` text, 
    342342  `domain_id` int(10) unsigned DEFAULT NULL, 
    343   `mail_type` varchar(20) DEFAULT NULL, 
     343  `mail_type` varchar(30) DEFAULT NULL, 
    344344  `sub_id` int(10) unsigned DEFAULT NULL, 
    345345  `status` varchar(255) DEFAULT NULL, 
    346   `mail_auto_respond` text, 
     346  `mail_auto_respond` BOOL NOT NULL default '0', 
     347  `mail_auto_respond_text` text, 
    347348  `quota` int(10) DEFAULT '10485760', 
    348349  `mail_addr` varchar(200) DEFAULT NULL, 
  • trunk/configs/debian/cron.d/parts/dmn_awstats_entry.tpl

    r1074 r1128  
    1 {MINUTE} {HOUR}  * * *   root perl /var/www/ispcp/engine/awstats/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang={USER_LANG} -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir=/var/www/virtual/{DMN_NAME}/statistics/ >/dev/null 2>&1 
     1{MINUTE} {HOUR}  * * *   root perl {AWSTATS_ROOT_DIR}/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang={USER_LANG} -awstatsprog={AWSTATS_ENGINE_DIR}/awstats.pl -dir={APACHE_WWW_DIR}/{DMN_NAME}/statistics/ >/dev/null 2>&1 
  • trunk/configs/debian/database/database.sql

    r1088 r1128  
    341341  `mail_forward` text, 
    342342  `domain_id` int(10) unsigned DEFAULT NULL, 
    343   `mail_type` varchar(20) DEFAULT NULL, 
     343  `mail_type` varchar(30) DEFAULT NULL, 
    344344  `sub_id` int(10) unsigned DEFAULT NULL, 
    345345  `status` varchar(255) DEFAULT NULL, 
    346   `mail_auto_respond` text, 
     346  `mail_auto_respond` BOOL NOT NULL default '0', 
     347  `mail_auto_respond_text` text, 
    347348  `quota` int(10) DEFAULT '10485760', 
    348349  `mail_addr` varchar(200) DEFAULT NULL, 
  • trunk/configs/fedora/cron.d/parts/dmn_awstats_entry.tpl

    r1007 r1128  
    1 {MINUTE} {HOUR}  * * *   root perl /var/www/ispcp/engine/awstats/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang=en -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir=/var/www/virtual/{DMN_NAME}/statistics/ >/dev/null 2>&1 
     1{MINUTE} {HOUR}  * * *   root perl {AWSTATS_ROOT_DIR}/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang={USER_LANG} -awstatsprog={AWSTATS_ENGINE_DIR}/awstats.pl -dir={APACHE_WWW_DIR}/{DMN_NAME}/statistics/ >/dev/null 2>&1 
  • trunk/configs/fedora/database/database.sql

    r1088 r1128  
    341341  `mail_forward` text, 
    342342  `domain_id` int(10) unsigned DEFAULT NULL, 
    343   `mail_type` varchar(20) DEFAULT NULL, 
     343  `mail_type` varchar(30) DEFAULT NULL, 
    344344  `sub_id` int(10) unsigned DEFAULT NULL, 
    345345  `status` varchar(255) DEFAULT NULL, 
    346   `mail_auto_respond` text, 
     346  `mail_auto_respond` BOOL NOT NULL default '0', 
     347  `mail_auto_respond_text` text, 
    347348  `quota` int(10) DEFAULT '10485760', 
    348349  `mail_addr` varchar(200) DEFAULT NULL, 
  • trunk/configs/freebsd/cron.d/parts/dmn_awstats_entry.tpl

    r1001 r1128  
    1 {MINUTE} {HOUR}  * * *   root perl /var/www/ispcp/engine/awstats/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang=en -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir=/var/www/virtual/{DMN_NAME}/statistics/ >/dev/null 2>&1 
     1{MINUTE} {HOUR}  * * *   root perl {AWSTATS_ROOT_DIR}/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang={USER_LANG} -awstatsprog={AWSTATS_ENGINE_DIR}/awstats.pl -dir={APACHE_WWW_DIR}/{DMN_NAME}/statistics/ >/dev/null 2>&1 
  • trunk/configs/freebsd/database/database.sql

    r1088 r1128  
    341341  `mail_forward` text, 
    342342  `domain_id` int(10) unsigned DEFAULT NULL, 
    343   `mail_type` varchar(20) DEFAULT NULL, 
     343  `mail_type` varchar(30) DEFAULT NULL, 
    344344  `sub_id` int(10) unsigned DEFAULT NULL, 
    345345  `status` varchar(255) DEFAULT NULL, 
    346   `mail_auto_respond` text, 
     346  `mail_auto_respond` BOOL NOT NULL default '0', 
     347  `mail_auto_respond_text` text, 
    347348  `quota` int(10) DEFAULT '10485760', 
    348349  `mail_addr` varchar(200) DEFAULT NULL, 
  • trunk/configs/gentoo/cron.d/parts/dmn_awstats_entry.tpl

    r1007 r1128  
    1 {MINUTE} {HOUR}  * * *   root perl /var/www/ispcp/engine/awstats/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang=en -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir=/var/www/virtual/{DMN_NAME}/statistics/ >/dev/null 2>&1 
     1{MINUTE} {HOUR}  * * *   root perl {AWSTATS_ROOT_DIR}/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang={USER_LANG} -awstatsprog={AWSTATS_ENGINE_DIR}/awstats.pl -dir={APACHE_WWW_DIR}/{DMN_NAME}/statistics/ >/dev/null 2>&1 
  • trunk/configs/gentoo/database/database.sql

    r1088 r1128  
    341341  `mail_forward` text, 
    342342  `domain_id` int(10) unsigned DEFAULT NULL, 
    343   `mail_type` varchar(20) DEFAULT NULL, 
     343  `mail_type` varchar(30) DEFAULT NULL, 
    344344  `sub_id` int(10) unsigned DEFAULT NULL, 
    345345  `status` varchar(255) DEFAULT NULL, 
    346   `mail_auto_respond` text, 
     346  `mail_auto_respond` BOOL NOT NULL default '0', 
     347  `mail_auto_respond_text` text, 
    347348  `quota` int(10) DEFAULT '10485760', 
    348349  `mail_addr` varchar(200) DEFAULT NULL, 
  • trunk/configs/openbsd/cron.d/parts/dmn_awstats_entry.tpl

    r1007 r1128  
    1 {MINUTE} {HOUR}  * * *   root perl /var/www/ispcp/engine/awstats/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang=en -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir=/var/www/virtual/{DMN_NAME}/statistics/ >/dev/null 2>&1 
     1{MINUTE} {HOUR}  * * *   root perl {AWSTATS_ROOT_DIR}/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang={USER_LANG} -awstatsprog={AWSTATS_ENGINE_DIR}/awstats.pl -dir={APACHE_WWW_DIR}/{DMN_NAME}/statistics/ >/dev/null 2>&1 
  • trunk/configs/openbsd/database/database.sql

    r1088 r1128  
    341341  `mail_forward` text, 
    342342  `domain_id` int(10) unsigned DEFAULT NULL, 
    343   `mail_type` varchar(20) DEFAULT NULL, 
     343  `mail_type` varchar(30) DEFAULT NULL, 
    344344  `sub_id` int(10) unsigned DEFAULT NULL, 
    345345  `status` varchar(255) DEFAULT NULL, 
    346   `mail_auto_respond` text, 
     346  `mail_auto_respond` BOOL NOT NULL default '0', 
     347  `mail_auto_respond_text` text, 
    347348  `quota` int(10) DEFAULT '10485760', 
    348349  `mail_addr` varchar(200) DEFAULT NULL, 
  • trunk/configs/opensuse/apache/01_awstats.conf

    r1126 r1128  
    2222 
    2323Alias /awstatsicons "{AWSTATS_WEB_DIR}" 
    24  
    2524 
    2625NameVirtualHost 127.0.0.1:80 
  • trunk/configs/opensuse/cron.d/parts/dmn_awstats_entry.tpl

    r1007 r1128  
    1 {MINUTE} {HOUR}  * * *   root perl /var/www/ispcp/engine/awstats/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang=en -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir=/var/www/virtual/{DMN_NAME}/statistics/ >/dev/null 2>&1 
     1{MINUTE} {HOUR}  * * *   root perl {AWSTATS_ROOT_DIR}/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang={USER_LANG} -awstatsprog={AWSTATS_ENGINE_DIR}/awstats.pl -dir={APACHE_WWW_DIR}/{DMN_NAME}/statistics/ >/dev/null 2>&1 
  • trunk/configs/opensuse/database/database.sql

    r1088 r1128  
    341341  `mail_forward` text, 
    342342  `domain_id` int(10) unsigned DEFAULT NULL, 
    343   `mail_type` varchar(20) DEFAULT NULL, 
     343  `mail_type` varchar(30) DEFAULT NULL, 
    344344  `sub_id` int(10) unsigned DEFAULT NULL, 
    345345  `status` varchar(255) DEFAULT NULL, 
    346   `mail_auto_respond` text, 
     346  `mail_auto_respond` BOOL NOT NULL default '0', 
     347  `mail_auto_respond_text` text, 
    347348  `quota` int(10) DEFAULT '10485760', 
    348349  `mail_addr` varchar(200) DEFAULT NULL, 
  • trunk/configs/redhat/cron.d/parts/dmn_awstats_entry.tpl

    r1007 r1128  
    1 {MINUTE} {HOUR}  * * *   root perl /var/www/ispcp/engine/awstats/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang=en -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir=/var/www/virtual/{DMN_NAME}/statistics/ >/dev/null 2>&1 
     1{MINUTE} {HOUR}  * * *   root perl {AWSTATS_ROOT_DIR}/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang={USER_LANG} -awstatsprog={AWSTATS_ENGINE_DIR}/awstats.pl -dir={APACHE_WWW_DIR}/{DMN_NAME}/statistics/ >/dev/null 2>&1 
  • trunk/configs/redhat/database/database.sql

    r1088 r1128  
    341341  `mail_forward` text, 
    342342  `domain_id` int(10) unsigned DEFAULT NULL, 
    343   `mail_type` varchar(20) DEFAULT NULL, 
     343  `mail_type` varchar(30) DEFAULT NULL, 
    344344  `sub_id` int(10) unsigned DEFAULT NULL, 
    345345  `status` varchar(255) DEFAULT NULL, 
    346   `mail_auto_respond` text, 
     346  `mail_auto_respond` BOOL NOT NULL default '0', 
     347  `mail_auto_respond_text` text, 
    347348  `quota` int(10) DEFAULT '10485760', 
    348349  `mail_addr` varchar(200) DEFAULT NULL, 
  • trunk/configs/ubuntu/cron.d/parts/dmn_awstats_entry.tpl

    r1007 r1128  
    1 {MINUTE} {HOUR}  * * *   root perl /var/www/ispcp/engine/awstats/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang=en -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir=/var/www/virtual/{DMN_NAME}/statistics/ >/dev/null 2>&1 
     1{MINUTE} {HOUR}  * * *   root perl {AWSTATS_ROOT_DIR}/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang={USER_LANG} -awstatsprog={AWSTATS_ENGINE_DIR}/awstats.pl -dir={APACHE_WWW_DIR}/{DMN_NAME}/statistics/ >/dev/null 2>&1 
  • trunk/configs/ubuntu/database/database.sql

    r1088 r1128  
    341341  `mail_forward` text, 
    342342  `domain_id` int(10) unsigned DEFAULT NULL, 
    343   `mail_type` varchar(20) DEFAULT NULL, 
     343  `mail_type` varchar(30) DEFAULT NULL, 
    344344  `sub_id` int(10) unsigned DEFAULT NULL, 
    345345  `status` varchar(255) DEFAULT NULL, 
    346   `mail_auto_respond` text, 
     346  `mail_auto_respond` BOOL NOT NULL default '0', 
     347  `mail_auto_respond_text` text, 
    347348  `quota` int(10) DEFAULT '10485760', 
    348349  `mail_addr` varchar(200) DEFAULT NULL, 
  • trunk/engine/ispcp-dmn-mngr

    r1095 r1128  
    40514051    my $user_lang       = "en"; 
    40524052 
     4053    my $awstats_root_dir   = $main::cfg{'AWSTATS_ROOT_DIR'}; 
     4054    my $awstats_engine_dir = $main::cfg{'AWSTATS_ENGINE_DIR'}; 
     4055    my $awstats_www_dir    = $main::cfg{'AWSTATS_WWW_DIR'}; 
     4056 
    40534057    # Selecting user language 
    40544058    my $user_id = @$dmn_data[4]; 
     
    41394143                    '{MINUTE}' => $cronjob_minute, 
    41404144                    '{HOUR}' => $cronjob_hour, 
     4145                    '{AWSTATS_ROOT_DIR}' => $awstats_root_dir, 
     4146                    '{AWSTATS_ENGINE_DIR}' => $awstats_engine_dir, 
     4147                    '{APACHE_WWW_DIR}' => $awstats_www_dir, 
    41414148                    '{USER_LANG}' => $user_lang 
    41424149                   ); 
  • trunk/gui/client/edit_mail_acc.php

    r1124 r1128  
    3030$tpl->define_dynamic('forward_mail', 'page'); 
    3131 
    32 // page functions. 
     32// page functions 
    3333 
    3434function edit_mail_account(&$tpl, &$sql) { 
     
    7373                        if ($mail_type == MT_NORMAL_MAIL) { 
    7474                                $mtype[] = 1; 
    75                                 $res1 = exec_query($sql, "select domain_name from domain where domain_id=?", array($domain_id)); 
     75                                $res1 = exec_query($sql, "SELECT domain_name FROM domain WHERE domain_id=?", array($domain_id)); 
    7676                                $tmp1 = $res1->FetchRow(0); 
    7777                                $maildomain = $tmp1['domain_name']; 
    7878                        } else if ($mail_type == MT_NORMAL_FORWARD) { 
    7979                                $mtype[] = 4; 
    80                                 $res1 = exec_query($sql, "select domain_name from domain where domain_id=?", array($domain_id)); 
     80                                $res1 = exec_query($sql, "SELECT domain_name FROM domain WHERE domain_id=?", array($domain_id)); 
    8181                                $tmp1 = $res1->FetchRow(0); 
    8282                                $maildomain = $tmp1['domain_name']; 
    8383                        } else if ($mail_type == MT_ALIAS_MAIL) { 
    8484                                $mtype[] = 2; 
    85                                 $res1 = exec_query($sql, "select alias_name from domain_aliasses where alias_id=?", array($sub_id)); 
     85                                $res1 = exec_query($sql, "SELECT alias_name FROM domain_aliasses WHERE alias_id=?", array($sub_id)); 
    8686                                $tmp1 = $res1->FetchRow(0); 
    8787                                $maildomain = $tmp1['alias_name']; 
    8888                        } elseif ($mail_type == MT_ALIAS_FORWARD) { 
    8989                                $mtype[] = 5; 
    90                                 $res1 = exec_query($sql, "select alias_name from domain_aliasses where alias_id=?", array($sub_id)); 
     90                                $res1 = exec_query($sql, "SELECT alias_name FROM domain_aliasses WHERE alias_id=?", array($sub_id)); 
    9191                                $tmp1 = $res1->FetchRow(); 
    9292                                $maildomain = $tmp1['alias_name']; 
    9393                        } elseif ($mail_type == MT_SUBDOM_MAIL) { 
    9494                                $mtype[] = 3; 
    95                                 $res1 = exec_query($sql, "select subdomain_name from subdomain where subdomain_id=?", array($sub_id)); 
     95                                $res1 = exec_query($sql, "SELECT subdomain_name FROM subdomain WHERE subdomain_id=?", array($sub_id)); 
    9696                                $tmp1 = $res1->FetchRow(); 
    9797                                $maildomain = $tmp1['subdomain_name']; 
    98                                 $res1 = exec_query($sql, "select domain_name from domain where domain_id=?", array($domain_id)); 
     98                                $res1 = exec_query($sql, "SELECT domain_name FROM domain WHERE domain_id=?", array($domain_id)); 
    9999                                $tmp1 = $res1->FetchRow(0); 
    100100                                $maildomain = $maildomain . "." . $tmp1['domain_name']; 
    101101                        } elseif ($mail_type == MT_SUBDOM_FORWARD) { 
    102102                                $mtype[] = 6; 
    103                                 $res1 = exec_query($sql, "select subdomain_name from subdomain where subdomain_id=?", array($sub_id)); 
     103                                $res1 = exec_query($sql, "SELECT subdomain_name FROM subdomain WHERE subdomain_id=?", array($sub_id)); 
    104104                                $tmp1 = $res1->FetchRow(); 
    105105                                $maildomain = $tmp1['subdomain_name']; 
    106                                 $res1 = exec_query($sql, "select domain_name from domain where domain_id=?", array($domain_id)); 
     106                                $res1 = exec_query($sql, "SELECT domain_name FROM domain WHERE domain_id=?", array($domain_id)); 
    107107                                $tmp1 = $res1->FetchRow(0); 
    108108                                $maildomain = $maildomain . "." . $tmp1['domain_name']; 
     
    151151                return; 
    152152        } 
    153         if ($_POST['uaction'] != 'update_pass') { 
    154                 if (preg_match('/update_pass/', $_POST['uaction']) == 0) { 
     153        if (preg_match('/update_pass/', $_POST['uaction']) == 0) { 
     154                return; 
     155        } 
     156        if (preg_match('/update_forward/', $_POST['uaction']) == 1 || isset($_POST['mail_forward'])) { 
     157                // The user only wants to update the forward list, not the password 
     158                if ($_POST['pass'] === '' || $_POST['pass_rep'] === '') { 
    155159                        return; 
    156160                } 
    157                 if (preg_match('/update_forward/', $_POST['uaction']) == 1 || isset($_POST['mail_forward'])) { 
    158                         // The user only wants to update the forward list, not the password 
    159                         if ($_POST['pass'] === '' || $_POST['pass_rep'] === '') { 
    160                                 return; 
    161                         } 
    162                 } 
     161        } 
    163162 
    164163        $pass = escapeshellcmd($_POST['pass']); 
     
    184183 
    185184                $query = <<<SQL_QUERY 
    186           update 
    187               mail_users 
    188           set 
    189               mail_pass = ?, 
    190               status = ? 
    191           where 
    192               mail_id = ? 
     185          UPDATE 
     186              `mail_users` 
     187          SET 
     188              `mail_pass` = ?, 
     189              `status` = ? 
     190          WHERE 
     191              `mail_id` = ? 
    193192SQL_QUERY; 
    194193 
     
    289288$theme_color = $cfg['USER_INITIAL_THEME']; 
    290289 
    291 $tpl->assign(array('TR_CLIENT_EDIT_EMAIL_PAGE_TITLE' => tr('ispCP - Manage Mail and FTP / Edit mail account'), 
    292                 'THEME_COLOR_PATH' => "../themes/$theme_color", 
    293                 'THEME_CHARSET' => tr('encoding'), 
    294                 'ISP_LOGO' => get_logo($_SESSION['user_id']))); 
     290$tpl->assign( 
     291                array( 
     292                        'TR_CLIENT_EDIT_EMAIL_PAGE_TITLE' => tr('ispCP - Manage Mail and FTP / Edit mail account'), 
     293                        'THEME_COLOR_PATH' => "../themes/$theme_color", 
     294                        'THEME_CHARSET' => tr('encoding'), 
     295                        'ISP_LOGO' => get_logo($_SESSION['user_id']) 
     296                        ) 
     297                ); 
    295298 
    296299// dynamic page data. 
     
    309312check_permissions($tpl); 
    310313 
    311 $tpl->assign(array('TR_EDIT_EMAIL_ACCOUNT' => tr('Edit email account'), 
    312                 'TR_SAVE' => tr('Save'), 
    313                 'TR_PASSWORD' => tr('Password'), 
    314                 'TR_PASSWORD_REPEAT' => tr('Repeat password'), 
    315                 'TR_FORWARD_MAIL' => tr('Forward mail'), 
    316                 'TR_FORWARD_TO' => tr('Forward to'), 
    317                 'TR_FWD_HELP' => tr("Separate multiple email addresses with a line-break."), 
    318                 'TR_EDIT' => tr('Edit'))); 
     314$tpl->assign( 
     315                array( 
     316                        'TR_EDIT_EMAIL_ACCOUNT' => tr('Edit email account'), 
     317                        'TR_SAVE' => tr('Save'), 
     318                        'TR_PASSWORD' => tr('Password'), 
     319                        'TR_PASSWORD_REPEAT' => tr('Repeat password'), 
     320                        'TR_FORWARD_MAIL' => tr('Forward mail'), 
     321                        'TR_FORWARD_TO' => tr('Forward to'), 
     322                        'TR_FWD_HELP' => tr("Separate multiple email addresses with a line-break."), 
     323                        'TR_EDIT' => tr('Edit') 
     324                        ) 
     325                ); 
    319326 
    320327gen_page_message($tpl); 
     
    322329$tpl->prnt(); 
    323330 
    324 if ($cfg['DUMP_GUI_DEBUG']) dump_gui_debug(); 
     331if ($cfg['DUMP_GUI_DEBUG']) 
     332        dump_gui_debug(); 
    325333 
    326334unset_messages(); 
  • trunk/gui/include/database-update-functions.php

    r1125 r1128  
    7474function returnFunctionName($revision) { 
    7575        $functionName = "_databaseUpdate_" . $revision; 
    76          
     76 
    7777        return $functionName; 
    7878} 
     
    8383function executeDatabaseUpdates() { 
    8484        global $sql; 
    85          
     85 
    8686        while(checkNewRevisionExists()) { 
    8787                $newRevision    = getNextRevision(); 
     
    9090                if(function_exists($functionName)) { 
    9191                        $queryArray     = $functionName(); 
    92                          
     92 
    9393                        // Query to set the new Database Revision 
    9494                        $queryArray[]   = "UPDATE `config` SET `value` = '$newRevision' WHERE `name` = 'DATABASE_REVISION'"; 
    95                          
     95 
    9696                        $sql->StartTrans(); 
    97                          
     97 
    9898                        foreach($queryArray as $query) { 
    99                                 $sql->Execute($query);                          
     99                                $sql->Execute($query); 
    100100                        } 
    101                          
     101 
    102102                        // Prompt a error when a update fails 
    103103                        if ($sql->HasFailedTrans()) { 
    104104                                set_page_message(tr("Db update %s failed", $newRevision)); 
    105105                        } 
    106                          
     106 
    107107                        $sql->CompleteTrans(); 
    108108                        unset($queryArray); 
     
    121121function _databaseUpdate_1() { 
    122122        $sqlUpd = "INSERT INTO config (name, value) VALUES (DATABASE_REVISION , 1)"; 
    123          
     123 
    124124        return $sqlUpd; 
    125125} 
     
    180180function _databaseUpdate_3() { 
    181181        $sqlUpd[] = "ALTER IGNORE TABLE `orders_settings` CHANGE `id` `id` int(10) unsigned NOT NULL auto_increment;"; 
    182          
     182 
    183183        return $sqlUpd; 
    184184} 
     
    186186/* 
    187187 * Fix for ticket #1196 http://www.isp-control.net/ispcp/ticket/1196 (Benedikt Heintel, 2008-04-23) 
    188   */ 
     188 */ 
    189189function _databaseUpdate_4() { 
    190190        $sqlUpd = array(); 
    191          
     191 
    192192        $sqlUpd[] = "ALTER IGNORE TABLE `mail_users` CHANGE `mail_auto_respond` `mail_auto_respond_text` text collate utf8_unicode_ci;"; 
    193193        $sqlUpd[] = "ALTER IGNORE TABLE `mail_users` ADD `mail_auto_respond` BOOL NOT NULL default '0' AFTER `status`;"; 
    194194        $sqlUpd[] = "ALTER IGNORE TABLE `mail_users` CHANGE `mail_type` `mail_type` varchar(30);"; 
    195          
     195 
    196196        return $sqlUpd; 
    197 }       
     197} 
    198198?>