Changeset 1243

Show
Ignore:
Timestamp:
06/28/08 20:44:24 (2 months ago)
Author:
rats
Message:

GUI Update 1/5: admin

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gui/admin/ahp.php

    r1241 r1243  
    2323check_login(__FILE__); 
    2424 
    25 if (Config::get('HOSTING_PLANS_LEVEL') != strtolower('admin')) { 
     25if (strtolower(Config::get('HOSTING_PLANS_LEVEL')) != 'admin') { 
    2626        header('Location: index.php'); 
    2727        die(); 
     
    189189                $price = 0; 
    190190        } else { 
    191                 $price = $_POST['hp_price']
     191                $price = clean_input($_POST['hp_price'])
    192192        } 
    193193        if (empty($_POST['hp_setupfee'])) { 
    194194                $setup_fee = 0; 
    195195        } else { 
    196                 $setup_fee = $_POST['hp_setupfee']
     196                $setup_fee = clean_input($_POST['hp_setupfee'])
    197197        } 
    198198 
  • trunk/gui/admin/change_personal.php

    r1241 r1243  
    1818 *   http://opensource.org | osi@opensource.org 
    1919 */ 
     20 
     21require '../include/ispcp-lib.php'; 
     22 
     23check_login(__FILE__); 
     24 
     25$tpl = new pTemplate(); 
     26$tpl->define_dynamic('page', Config::get('ADMIN_TEMPLATE_PATH') . '/change_personal.tpl'); 
     27$tpl->define_dynamic('page_message', 'page'); 
     28$tpl->define_dynamic('hosting_plans', 'page'); 
     29 
     30$theme_color = Config::get('USER_INITIAL_THEME'); 
     31 
     32$tpl->assign( 
     33        array( 
     34                'TR_ADMIN_CHANGE_PERSONAL_DATA_PAGE_TITLE' => tr('ispCP - Admin/Change Personal Data'), 
     35                'THEME_COLOR_PATH' => "../themes/$theme_color", 
     36                'THEME_CHARSET' => tr('encoding'), 
     37                'ISP_LOGO' => get_logo($_SESSION['user_id']) 
     38                ) 
     39        ); 
     40 
     41if (isset($_POST['uaction']) && $_POST['uaction'] === 'updt_data') { 
     42        update_admin_personal_data($sql, $_SESSION['user_id']); 
     43} 
     44 
     45gen_admin_personal_data($tpl, $sql, $_SESSION['user_id']); 
    2046 
    2147function gen_admin_personal_data(&$tpl, &$sql, $user_id) { 
     
    113139} 
    114140 
    115 require '../include/ispcp-lib.php'; 
    116  
    117 check_login(__FILE__); 
    118  
    119 $tpl = new pTemplate(); 
    120 $tpl->define_dynamic('page', Config::get('ADMIN_TEMPLATE_PATH') . '/change_personal.tpl'); 
    121 $tpl->define_dynamic('page_message', 'page'); 
    122 $tpl->define_dynamic('hosting_plans', 'page'); 
    123  
    124 $theme_color = Config::get('USER_INITIAL_THEME'); 
    125  
    126 $tpl->assign( 
    127         array( 
    128                 'TR_ADMIN_CHANGE_PERSONAL_DATA_PAGE_TITLE' => tr('ispCP - Admin/Change Personal Data'), 
    129                 'THEME_COLOR_PATH' => "../themes/$theme_color", 
    130                 'THEME_CHARSET' => tr('encoding'), 
    131                 'ISP_LOGO' => get_logo($_SESSION['user_id']) 
    132                 ) 
    133         ); 
    134  
    135 if (isset($_POST['uaction']) && $_POST['uaction'] === 'updt_data') { 
    136         update_admin_personal_data($sql, $_SESSION['user_id']); 
    137 } 
    138  
    139 gen_admin_personal_data($tpl, $sql, $_SESSION['user_id']); 
    140  
    141141/* 
    142142 * 
  • trunk/gui/admin/change_status.php

    r1241 r1243  
    11<?php 
    22/** 
    3  *  ispCP (OMEGA) - Virtual Hosting Control System | Omega Version 
     3 *  ispCP ? (OMEGA) - Virtual Hosting Control System | Omega Version 
    44 * 
    55 *  @copyright  2001-2006 by moleSoftware GmbH 
    6  *  @copyright  2006-2007 by ispCP | http://isp-control.net 
     6 *  @copyright  2006-2008 by ispCP | http://isp-control.net 
    77 *  @link               http://isp-control.net 
    88 *  @author             ispCP Team (2007) 
  • trunk/gui/admin/change_user_interface.php

    r1241 r1243  
    44 * 
    55 * @copyright   2001-2006 by moleSoftware GmbH 
    6  * @copyright   2006-2007 by ispCP | http://isp-control.net 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
    77 * @version     SVN: $ID$ 
    88 * @link                http://isp-control.net 
  • trunk/gui/admin/database_update.php

    r1241 r1243  
    7070 
    7171 
    72 if(!checkDatabaseUpdateExists()) { 
    73         $tpl->assign('TR_UPDATE_MESSAGE', tr('No database updates available')); 
    74         $tpl->parse('DATABASE_UPDATE_MESSAGE', 'database_update_message'); 
    75 } else { 
    76         $tpl->assign('DATABASE_UPDATE_MESSAGE', ''); 
    77 } 
    78  
    79  
    8072if(checkDatabaseUpdateExists()) { 
    8173        $tpl->assign(array( 
    82                 'UPDATE_MESSAGE' =>  '', 
    83                 'UPDATE' =>  tr('New Database update is now available'), 
    84                 'INFOS' => tr('Do you want to execute the Updates now?'), 
     74                'UPDATE_MESSAGE'                        => '', 
     75                'DATABASE_UPDATE_MESSAGE'       => '', 
     76                'UPDATE'                                        => tr('New Database update is now available'), 
     77                'INFOS'                                         => tr('Do you want to execute the Updates now?') 
    8578        )); 
    8679        $tpl->parse('DATABASE_UPDATE_INFOS', 'database_update_infos'); 
    8780} else { 
    88         $tpl->assign('DATABASE_UPDATE_INFOS', ''); 
     81        $tpl->assign(array( 
     82                'TR_UPDATE_MESSAGE'             => tr('No database updates available'), 
     83                'DATABASE_UPDATE_INFOS'         => '' 
     84        )); 
     85        $tpl->parse('DATABASE_UPDATE_MESSAGE', 'database_update_message'); 
    8986} 
    9087 
  • trunk/gui/admin/delete_ip.php

    r1241 r1243  
    44 * 
    55 * @copyright   2001-2006 by moleSoftware GmbH 
    6  * @copyright   2006-2007 by ispCP | http://isp-control.net 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
    77 * @version     SVN: $ID$ 
    88 * @link                http://isp-control.net 
     
    9292$ip_number = $rs->fields['ip_number']; 
    9393 
    94 write_log("$user_logged: delete IP address $ip_number"); 
     94write_log("$user_logged: deletes IP address $ip_number"); 
    9595 
    9696/* delete it ! */ 
  • trunk/gui/admin/delete_lang.php

    r1241 r1243  
    11<?php 
    22/** 
    3  * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version 
     3 * ispCP ω (OMEGA) a Virtual Hosting Control System 
    44 * 
    5  *  @copyright  2001-2006 by moleSoftware GmbH 
    6  *  @copyright  2006-2007 by ispCP | http://isp-control.net 
    7  *  @link               http://isp-control.net 
    8  *  @author             ispCP Team (2007) 
     5 * @copyright   2001-2006 by moleSoftware GmbH 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
     7 * @version     SVN: $ID$ 
     8 * @link                http://isp-control.net 
     9 * @author              ispCP Team 
    910 * 
    10  *  @license 
    11  *  This program is free software; you can redistribute it and/or modify it under 
    12  *  the terms of the MPL General Public License as published by the Free Software 
    13  *  Foundation; either version 1.1 of the License, or (at your option) any later 
    14  *  version. 
    15  *  You should have received a copy of the MPL Mozilla Public License along with 
    16  *  this program; if not, write to the Open Source Initiative (OSI) 
    17  *  http://opensource.org | osi@opensource.org 
    18  **/ 
    19  
    20  
     11 * @license 
     12 *   This program is free software; you can redistribute it and/or modify it under 
     13 *   the terms of the MPL General Public License as published by the Free Software 
     14 *   Foundation; either version 1.1 of the License, or (at your option) any later 
     15 *   version. 
     16 *   You should have received a copy of the MPL Mozilla Public License along with 
     17 *   this program; if not, write to the Open Source Initiative (OSI) 
     18 *   http://opensource.org | osi@opensource.org 
     19 */ 
    2120 
    2221require '../include/ispcp-lib.php'; 
     
    7372$rs = exec_query($sql, $query, array()); 
    7473 
    75 /* 
    76  
    77 if( $exstatus != 0) { 
    78     $error = "000017"; 
    79     set_page_message('Error 000017!'); 
    80  
    81     header( "Location: multilanguage.php" ); 
    82     die(); 
    83 
    84 */ 
    85 write_log("$admin_login: remove language $delete_lang!"); 
     74write_log(sprintf("%s removed language: %s", $_SESSION['user_logged'], $delete_lang)); 
    8675 
    8776set_page_message('Language was removed!'); 
  • trunk/gui/admin/delete_user.php

    r1241 r1243  
    11<?php 
    22/** 
    3  * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version 
     3 * ispCP ω (OMEGA) a Virtual Hosting Control System 
    44 * 
    5  *  @copyright  2001-2006 by moleSoftware GmbH 
    6  *  @copyright  2006-2007 by ispCP | http://isp-control.net 
    7  *  @link               http://isp-control.net 
    8  *  @author             ispCP Team (2007) 
     5 * @copyright   2001-2006 by moleSoftware GmbH 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
     7 * @version     SVN: $ID$ 
     8 * @link                http://isp-control.net 
     9 * @author              ispCP Team 
    910 * 
    10  * @license 
    11  *  This program is free software; you can redistribute it and/or modify it under 
    12  *  the terms of the MPL General Public License as published by the Free Software 
    13  *  Foundation; either version 1.1 of the License, or (at your option) any later 
    14  *  version. 
    15  *  You should have received a copy of the MPL Mozilla Public License along with 
    16  *  this program; if not, write to the Open Source Initiative (OSI) 
    17  *  http://opensource.org | osi@opensource.org 
    18  **
     11 * @license 
     12 *  This program is free software; you can redistribute it and/or modify it under 
     13 *  the terms of the MPL General Public License as published by the Free Software 
     14 *  Foundation; either version 1.1 of the License, or (at your option) any later 
     15 *  version. 
     16 *  You should have received a copy of the MPL Mozilla Public License along with 
     17 *  this program; if not, write to the Open Source Initiative (OSI) 
     18 *  http://opensource.org | osi@opensource.org 
     19 *
    1920 
    2021require '../include/ispcp-lib.php'; 
     
    7273$rs = exec_query($sql, $query, array($delete_id)); 
    7374 
    74 if ($rs -> fields['children'] > 0 && $local_admin_type !== 'user') { 
     75if ($rs->fields['children'] > 0 && $local_admin_type !== 'user') { 
    7576  /* this user have domain ! */ 
    7677  $hdomain = 1; 
     
    107108    $rs = exec_query($sql, $query, array($delete_id)); 
    108109 
    109                // delete orders 
     110        // delete orders 
    110111         $query = <<<SQL_QUERY 
    111112            delete from 
     
    117118        $rs = exec_query($sql, $query, array($delete_id)); 
    118119 
    119                        // delete orders settings 
     120        // delete orders settings 
    120121         $query = <<<SQL_QUERY 
    121122            delete from 
     
    135136SQL_QUERY; 
    136137    $rs = exec_query($sql, $query, array($delete_id)); 
    137  
    138                 /* 
    139  
    140                  $query = <<<SQL_QUERY 
    141  
    142         select 
    143  
    144             admin_id 
    145  
    146                 from 
    147                         admin 
    148  
    149         where 
    150  
    151             created_by = '$delete_id' 
    152  
    153 SQL_QUERY; 
    154  
    155         $rs = execute_query($sql, $query); 
    156  
    157                         while (!$rs -> EOF) { 
    158                                 $delete_user_account_id = $rs -> fields['admin_id']; 
    159                                 print $delete_user_account_id."<br>"; 
    160                                 rm_rf_user_account ($delete_user_account_id); 
    161                         } 
    162                         die (); 
    163                         */ 
    164  
    165138 
    166139  } else if ($local_admin_type == 'user') { 
     
    187160  $user_logged= $_SESSION['user_logged']; 
    188161  $local_admin_name = $_GET['delete_username']; 
    189   write_log("$user_logged: delete user $local_admin_name, $local_admin_type, $delete_id!"); 
     162  write_log("$user_logged: deletes user $local_admin_name, $local_admin_type, $delete_id!"); 
    190163  $_SESSION['user_deleted'] = 1; 
    191164  header("Location: manage_users.php"); 
  • trunk/gui/admin/dhp.php

    r1241 r1243  
    11<?php 
    22/** 
    3  * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version 
     3 * ispCP ω (OMEGA) a Virtual Hosting Control System 
    44 * 
    5  *  @copyright  2001-2006 by moleSoftware GmbH 
    6  *  @copyright  2006-2007 by ispCP | http://isp-control.net 
    7  *  @link               http://isp-control.net 
    8  *  @author             ispCP Team (2007) 
     5 * @copyright   2001-2006 by moleSoftware GmbH 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
     7 * @version     SVN: $ID$ 
     8 * @link                http://isp-control.net 
     9 * @author              ispCP Team 
    910 * 
    10  * @license 
    11  *  This program is free software; you can redistribute it and/or modify it under 
    12  *  the terms of the MPL General Public License as published by the Free Software 
    13  *  Foundation; either version 1.1 of the License, or (at your option) any later 
    14  *  version. 
    15  *  You should have received a copy of the MPL Mozilla Public License along with 
    16  *  this program; if not, write to the Open Source Initiative (OSI) 
    17  *  http://opensource.org | osi@opensource.org 
    18  **
     11 * @license 
     12 *  This program is free software; you can redistribute it and/or modify it under 
     13 *  the terms of the MPL General Public License as published by the Free Software 
     14 *  Foundation; either version 1.1 of the License, or (at your option) any later 
     15 *  version. 
     16 *  You should have received a copy of the MPL Mozilla Public License along with 
     17 *  this program; if not, write to the Open Source Initiative (OSI) 
     18 *  http://opensource.org | osi@opensource.org 
     19 *
    1920 
    2021require '../include/ispcp-lib.php'; 
     
    2223check_login(__FILE__); 
    2324 
    24 $theme_color = Config::get('USER_INITIAL_THEME'); 
     25if (strtolower(Config::get('HOSTING_PLANS_LEVEL')) != 'admin') { 
     26        header('Location: index.php'); 
     27        die(); 
     28
     29 
    2530 
    2631if(isset($_GET['hpid']) && is_numeric($_GET['hpid'])) 
    2732        $hpid = $_GET['hpid']; 
    28 else
     33else
    2934        $_SESSION['hp_deleted'] = '_no_'; 
    3035        Header('Location: hp.php'); 
     
    3237} 
    3338 
     39// Check if there is no order for this plan 
     40$res = exec_query($sql, "SELECT COUNT(id) FROM `orders` WHERE `plan_id`=? AND `status`='new'", array($hpid)); 
     41$data = $res->FetchRow(); 
     42if ($data['0'] > 0) { 
     43        $_SESSION['hp_deleted_ordererror'] = '_yes_'; 
     44        header("Location: hp.php"); 
     45        die(); 
     46} 
     47 
    3448// Try to delete hosting plan from db 
    35 // 
    36 $query = 'delete from hosting_plans where id=?'; 
     49$query = 'delete from hosting_plans where id = ?'; 
    3750$res = exec_query($sql, $query, array($hpid)); 
    3851 
    3952$_SESSION['hp_deleted'] = '_yes_'; 
    4053 
    41 Header('Location: hp.php'); 
    42  
     54header('Location: hp.php'); 
    4355die(); 
    4456 
  • trunk/gui/admin/domain_details.php

    r1241 r1243  
    131131                $dstatus = translate_dmn_status($data['domain_status']); 
    132132        } else { 
    133                 $dstatus = "<b><font size=3 color=red>" . $data['domain_status'] . "</font></b>"; 
     133                $dstatus = "<b><font size=\"3\" color=red>" . $data['domain_status'] . "</font></b>"; 
    134134        } 
    135135 
  • trunk/gui/admin/edit_admin.php

    r1241 r1243  
    44 * 
    55 * @copyright   2001-2006 by moleSoftware GmbH 
    6  * @copyright   2006-2007 by ispCP | http://isp-control.net 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
    77 * @link                http://isp-control.net 
    88 * @author              ispCP Team (2007) 
     
    4343                        'THEME_CHARSET' => tr('encoding'), 
    4444                        'ISP_LOGO' => get_logo($_SESSION['user_id']), 
    45                          
     45 
    4646                        ) 
    4747        ); 
     
    176176                        $user_logged = $_SESSION['user_logged']; 
    177177 
    178                         write_log("$user_logged: change data/password for $edit_username!"); 
     178                        write_log("$user_logged: changes data/password of $edit_username!"); 
    179179 
    180180                        if (isset($_POST['send_data']) && !empty($_POST['pass'])) { 
  • trunk/gui/admin/edit_domain.php

    r1241 r1243  
    118118        SELECT 
    119119                a.created_by 
    120         FROM  
     120        FROM 
    121121                domain d, admin a 
    122         WHERE  
    123                 d.domain_id = ?  
     122        WHERE 
     123                d.domain_id = ? 
    124124            AND d.domain_admin_id = a.admin_id 
    125125SQL_QUERY; 
     
    347347                $ed_error .= tr('Incorrect disk quota limit!'); 
    348348        } 
    349          
     349 
    350350        // $user_props = generate_user_props($user_id); 
    351351        // $reseller_props = generate_reseller_props($reseller_id); 
     
    486486                if ($data == -1) { 
    487487                        if ($u > 0) { 
    488                                 $err .= tr('The <em>%s</em> service can not be disabled! ', $obj) . tr('There are <em>%s</em> records on system!', $obj); 
     488                                $err .= tr('The <em>%s</em> service cannot be disabled! ', $obj) . tr('There are <em>%s</em> records on system!', $obj); 
    489489                        } else { 
    490490                                $umax = $data; 
     
    496496                } else if ($data > 0) { 
    497497                        if ($u > $data) { 
    498                                 $err .= tr('The <em>%s</em> service can not be limited! ', $obj) . tr('Specified number is smaller than <em>%s</em> records, present on the system!', $obj); 
     498                                $err .= tr('The <em>%s</em> service cannot be limited! ', $obj) . tr('Specified number is smaller than <em>%s</em> records, present on the system!', $obj); 
    499499                        } else { 
    500500                                $umax = $data; 
     
    506506                if ($data == -1) { 
    507507                        if ($u > 0) { 
    508                                 $err .= tr('The <em>%s</em> service can not be disabled! ', $obj) . tr('There are <em>%s</em> records on the system!', $obj); 
     508                                $err .= tr('The <em>%s</em> service cannot be disabled! ', $obj) . tr('There are <em>%s</em> records on the system!', $obj); 
    509509                        } else { 
    510510                                $r -= $umax; 
     
    518518                } else if ($data > 0) { 
    519519                        if ($u > $data) { 
    520                                 $err .= tr('The <em>%s</em> service can not be limited! ', $obj) . tr('Specified number is smaller than <em>%s</em> records, present on the system!', $obj); 
     520                                $err .= tr('The <em>%s</em> service cannot be limited! ', $obj) . tr('Specified number is smaller than <em>%s</em> records, present on the system!', $obj); 
    521521                        } else { 
    522522                                if ($umax > $data) { 
     
    535535                        return; 
    536536                } else if ($data == 0) { 
    537                         $err .= tr('The <em>%s</em> service can not be unlimited! ', $obj) . tr('There are reseller limits for the <em>%s</em> service!', $obj); 
     537                        $err .= tr('The <em>%s</em> service cannot be unlimited! ', $obj) . tr('There are reseller limits for the <em>%s</em> service!', $obj); 
    538538                        return; 
    539539                } else if ($data > 0) { 
    540540                        if ($r + $data > $rmax) { 
    541                                 $err .= tr('The <em>%s</em> service can not be limited! ', $obj) . tr('You are exceeding reseller limits for the <em>%s</em> service!', $obj); 
     541                                $err .= tr('The <em>%s</em> service cannot be limited! ', $obj) . tr('You are exceeding reseller limits for the <em>%s</em> service!', $obj); 
    542542                        } else { 
    543543                                $r += $data; 
     
    560560                if ($data == -1) { 
    561561                        if ($u > 0) { 
    562                                 $err .= tr('The <em>%s</em> service can not be disabled! ', $obj) . tr('There are <em>%s</em> records on the system!', $obj); 
     562                                $err .= tr('The <em>%s</em> service cannot be disabled! ', $obj) . tr('There are <em>%s</em> records on the system!', $obj); 
    563563                        } else { 
    564564                                $r -= $umax; 
     
    568568                        return; 
    569569                } else if ($data == 0) { 
    570                         $err .= tr('The <em>%s</em> service can not be unlimited! ', $obj) . tr('There are reseller limits for the <em>%s</em> service!', $obj); 
     570                        $err .= tr('The <em>%s</em> service cannot be unlimited! ', $obj) . tr('There are reseller limits for the <em>%s</em> service!', $obj); 
    571571 
    572572                        return; 
    573573                } else if ($data > 0) { 
    574574                        if ($u > $data) { 
    575                                 $err .= tr('The <em>%s</em> service can not be limited! ', $obj) . tr('Specified number is smaller than <em>%s</em> records, present on the system!', $obj); 
     575                                $err .= tr('The <em>%s</em> service cannot be limited! ', $obj) . tr('Specified number is smaller than <em>%s</em> records, present on the system!', $obj); 
    576576                        } else { 
    577577                                if ($umax > $data) { 
     
    582582 
    583583                                        if ($r + $data_inc > $rmax) { 
    584                                                 $err .= tr('The <em>%s</em> service can not be limited! ', $obj) . tr('You are exceeding reseller limits for the <em>%s</em> service!', $obj); 
     584                                                $err .= tr('The <em>%s</em> service cannot be limited! ', $obj) . tr('You are exceeding reseller limits for the <em>%s</em> service!', $obj); 
    585585                                                return; 
    586586                                        } 
  • trunk/gui/admin/edit_reseller.php

    r1241 r1243  
    383383} 
    384384 
    385 function check_user_ip_data($reseller_id, $r_ips, $u_ips, &$err) 
    386 
     385function check_user_ip_data($reseller_id, $r_ips, $u_ips, &$err) { 
    387386        if ($r_ips == $u_ips) { 
    388387                return; 
     
    600599                        $user_logged = $_SESSION['user_logged']; 
    601600 
    602                         write_log("$user_logged: change data/password for reseller: $edit_username!"); 
     601                        write_log("$user_logged: changes data/password for reseller: $edit_username!"); 
    603602 
    604603                        if (isset($_POST['send_data']) && !empty($_POST['pass'])) { 
     
    830829 
    831830$tpl->parse('PAGE', 'page'); 
    832  
    833831$tpl->prnt(); 
    834832 
  • trunk/gui/admin/ehp.php

    r1241 r1243  
    2323check_login(__FILE__); 
    2424 
    25 if (Config::get('HOSTING_PLANS_LEVEL') != strtolower('admin')) { 
     25if (strtolower(Config::get('HOSTING_PLANS_LEVEL')) != 'admin') { 
    2626        header('Location: index.php'); 
    2727        die(); 
  • trunk/gui/admin/email_setup.php

    r1241 r1243  
    8888                        'TR_SENDER_NAME' => tr('Senders name'), 
    8989                        'TR_APPLY_CHANGES' => tr('Apply changes'), 
     90                        'TR_USERTYPE' => tr('User type (admin, reseller, user)'), 
     91                        'TR_BASE_SERVER_VHOST' => tr('URL to this admin panel'), 
    9092                        'SUBJECT_VALUE' => $data['subject'], 
    9193                        'MESSAGE_VALUE' => $data['message'], 
  • trunk/gui/admin/hp.php

    r1241 r1243  
    2424check_login(__FILE__); 
    2525 
    26 if (Config::get('HOSTING_PLANS_LEVEL') != strtolower('admin')) { 
     26if (strtolower(Config::get('HOSTING_PLANS_LEVEL')) != 'admin') { 
    2727        header('Location: index.php'); 
    28  
    2928        die(); 
    3029} 
     
    3332$tpl->define_dynamic('page', Config::get('ADMIN_TEMPLATE_PATH') . '/hp.tpl'); 
    3433$tpl->define_dynamic('page_message', 'page'); 
    35 $tpl->define_dynamic('page_message', 'page'); 
    3634$tpl->define_dynamic('hosting_plans', 'page'); 
    3735// Table with hosting plans 
    3836$tpl->define_dynamic('hp_table', 'page'); 
    3937$tpl->define_dynamic('hp_entry', 'hp_table'); 
     38$tpl->define_dynamic('hp_delete', 'page'); 
     39$tpl->define_dynamic('hp_menu_add', 'page'); 
    4040 
    4141$theme_color = Config::get('USER_INITIAL_THEME'); 
    4242 
    43 $tpl->assign(array('TR_RESELLER_MAIN_INDEX_PAGE_TITLE' => tr('ispCP - Administrator/Hosting Plan Management'), 
    44                 'THEME_COLOR_PATH' => "../themes/$theme_color", 
    45                 'THEME_CHARSET' => tr('encoding'), 
    46                 'ISP_LOGO' => get_logo($_SESSION['user_id']))); 
     43$tpl->assign(array( 
     44        'TR_RESELLER_MAIN_INDEX_PAGE_TITLE' => tr('ispCP - Administrator/Hosting Plan Management'), 
     45        'THEME_COLOR_PATH' => "../themes/$theme_color", 
     46        'THEME_CHARSET' => tr('encoding'), 
     47        'ISP_LOGO' => get_logo($_SESSION['user_id']) 
     48)); 
    4749 
    4850/* 
     
    5658gen_hp_table($tpl, $_SESSION['user_id']); 
    5759 
    58 $tpl->assign(array('TR_HOSTING_PLANS' => tr('Hosting plans'), 
    59                 'TR_PAGE_MENU' => tr('Manage hosting plans'), 
    60                 'TR_PURCHASING' => tr('Purchasing'), 
    61                 'TR_ADD_HOSTING_PLAN' => tr('Add hosting plan'), 
    62                 'TR_TITLE_ADD_HOSTING_PLAN' => tr('Add new user hosting plan'), 
    63                 'TR_BACK' => tr('Back'), 
    64                 'TR_TITLE_BACK' => tr('Return to previous menu'), 
    65                 'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete'))); 
     60$tpl->assign( 
     61                array( 
     62                        'TR_HOSTING_PLANS' => tr('Hosting plans'), 
     63                        'TR_PAGE_MENU' => tr('Manage hosting plans'), 
     64                        'TR_PURCHASING' => tr('Purchasing'), 
     65                        'TR_ADD_HOSTING_PLAN' => tr('Add hosting plan'), 
     66                        'TR_TITLE_ADD_HOSTING_PLAN' => tr('Add new user hosting plan'), 
     67                        'TR_BACK' => tr('Back'), 
     68                        'TR_TITLE_BACK' => tr('Return to previous menu'), 
     69                        'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete') 
     70                        ) 
     71                ); 
    6672 
    6773gen_hp_message(); 
     
    9399                if (isset($GLOBALS['hp_updated'])) 
    94100                        unset($GLOBALS['hp_updated']); 
     101        } else if (isset($_SESSION["hp_deleted_ordererror"]) && $_SESSION["hp_deleted_ordererror"] == '_yes_') { 
     102                //$external_event = '_on_'; 
     103                set_page_message(tr('Hosting plan can\'t be deleted, there are orders!')); 
     104                unset($_SESSION["hp_deleted_ordererror"]); 
    95105        } 
    96106} // End of gen_hp_message() 
     
    126136                }*/ 
    127137 
    128                 $tpl->assign(array('TR_HOSTING_PLANS' => tr('Hosting plans'), 
    129                                 'TR_NOM' => tr('No.'), 
    130                                 'TR_EDIT' => $tr_edit, 
    131                                 'TR_PLAN_NAME' => tr('Name'), 
    132                                 'TR_ACTION' => tr('Action'))); 
     138                $tpl->assign( 
     139                                array( 
     140                                        'TR_HOSTING_PLANS' => tr('Hosting plans'), 
     141                                        'TR_NOM' => tr('No.'), 
     142                                        'TR_EDIT' => $tr_edit, 
     143                                        'TR_PLAN_NAME' => tr('Name'), 
     144                                        'TR_ACTION' => tr('Action') 
     145                                        ) 
     146                                ); 
    133147 
    134148                $i = 1; 
     
    147161                        } 
    148162 
    149                         $tpl->assign(array('PLAN_NOM' => $i++, 
    150                                         'PLAN_NAME' => stripslashes($data['name']), 
    151                                         'PLAN_ACTION' => tr('Delete'), 
    152                                         'PLAN_SHOW' => tr('Show hosting plan'), 
    153                                         'PURCHASING' => $status, 
    154                                         'HP_ID' => $data['id'], 
    155                                         'ADMIN_ID' => $_SESSION['user_id'])); 
     163                        $tpl->assign( 
     164                                        array( 
     165                                                'PLAN_NOM' => $i++, 
     166                                                'PLAN_NAME' => stripslashes($data['name']), 
     167                                                'PLAN_ACTION' => tr('Delete'), 
     168                                                'PLAN_SHOW' => tr('Show hosting plan'), 
     169                                                'PURCHASING' => $status, 
     170                                                'HP_ID' => $data['id'], 
     171                                                'ADMIN_ID' => $_SESSION['user_id'] 
     172                                                ) 
     173                                        ); 
    156174                        $tpl->parse('HP_ENTRY', '.hp_entry'); 
    157175                } // End  loop 
     
    159177        } 
    160178} // End of gen_hp_table() 
    161 // ****************************** 
    162 // END OF FUNCTION DECLARE PATH 
    163 // ***************************** 
     179 
    164180if (Config::get('DUMP_GUI_DEBUG')) dump_gui_debug(); 
    165181 
  • trunk/gui/admin/index.php

    r1241 r1243  
    7070 
    7171function get_update_infos(&$tpl) { 
     72 
     73        // Check if there is no order for this plan 
     74        $res = exec_query($sql, "SELECT COUNT(id) FROM `orders` WHERE `plan_id`=? AND `status`='new'", array($hpid)); 
     75        $data = $res->FetchRow(); 
     76        if ($data['0'] > 0) { 
     77                $_SESSION['hp_deleted_ordererror'] = '_yes_'; 
     78                header("Location: hp.php"); 
     79                die(); 
     80        } 
     81 
    7282        $last_update = "http://www.isp-control.net/latest.txt"; 
    7383        // Fake the browser type 
  • trunk/gui/admin/ip_manage.php

    r1241 r1243  
    126126                        $user_logged = $_SESSION['user_logged']; 
    127127 
    128                         write_log("$user_logged: add new IP4 address: $ip_number!"); 
     128                        write_log("$user_logged: adds new IPv4 address: $ip_number!"); 
    129129 
    130130                        $sucess = true; 
  • trunk/gui/admin/ispcp_updates.php

    r1241 r1243  
    2323check_login(__FILE__); 
    2424 
     25$theme_color = $cfg['USER_INITIAL_THEME']; 
     26 
     27$tpl = new pTemplate(); 
     28$tpl->define_dynamic('page', Config::get('ADMIN_TEMPLATE_PATH') . '/ispcp_updates.tpl'); 
     29$tpl->define_dynamic('page_message', 'page'); 
     30$tpl->define_dynamic('hosting_plans', 'page'); 
     31$tpl->define_dynamic('update_message', 'page'); 
     32$tpl->define_dynamic('update_infos', 'page'); 
     33 
     34$tpl->assign( 
     35        array( 
     36                'TR_ADMIN_ISPCP_UPDATES_PAGE_TITLE' => tr('ispCP - Virtual Hosting Control System'), 
     37                'THEME_COLOR_PATH' => "../themes/$theme_color", 
     38                'THEME_CHARSET' => tr('encoding'), 
     39                'ISP_LOGO' => get_logo($_SESSION['user_id']) 
     40                ) 
     41        ); 
     42 
    2543/* BEGIN common functions */ 
    2644function get_update_infos(&$tpl) { 
     45 
     46// Check if there is no order for this plan 
     47$res = exec_query($sql, "SELECT COUNT(id) FROM `orders` WHERE `plan_id`=? AND `status`='new'", array($hpid)); 
     48$data = $res->FetchRow(); 
     49if ($data['0'] > 0) { 
     50        $_SESSION['hp_deleted_ordererror'] = '_yes_'; 
     51        header("Location: hp.php"); 
     52        die(); 
     53} 
     54 
    2755        $info_url = 'http://www.isp-control.net/download.html'; 
    2856        $last_update = 'http://www.isp-control.net/latest.txt'; 
     
    4775        if ($current_version < $last_update_result) { 
    4876                $tpl->assign( 
    49                         array('UPDATE_MESSAGE' => '', 
     77                        array( 
     78                                'UPDATE_MESSAGE' => '', 
    5079                                'UPDATE' => tr('New ispCP update is now available'), 
    5180                                'INFOS' => tr('Get it at') . " <a href=\"" . $info_url . "\" class=\"link\" target=\"ispcp\">" . $info_url . "</a>" 
     
    6089/* END system functions */ 
    6190 
    62 $tpl = new pTemplate(); 
    63 $tpl->define_dynamic('page', Config::get('ADMIN_TEMPLATE_PATH') . '/ispcp_updates.tpl'); 
    64 $tpl->define_dynamic('page_message', 'page'); 
    65 $tpl->define_dynamic('hosting_plans', 'page'); 
    66 $tpl->define_dynamic('update_message', 'page'); 
    67 $tpl->define_dynamic('update_infos', 'page'); 
    68  
    69 $theme_color = Config::get('USER_INITIAL_THEME'); 
    70  
    71 $tpl->assign( 
    72         array('TR_ADMIN_ISPCP_UPDATES_PAGE_TITLE' => tr('ispCP - Virtual Hosting Control System'),