Beispiel #1
0
 function update_teleline($forms)
 {
     global $DB, $LMS, $lineinfo;
     $obj = new xajaxResponse();
     $form = $forms['lineedit'];
     $blad = false;
     if (!isset($form['name']) || $form['name'] == '') {
         $blad = true;
         $obj->script("addClassId('lineedit_name','alerts');");
     } else {
         $obj->script("removeClassId('lineedit_name','alerts');");
     }
     // sprawdzamy czy nazwa czasem nie istnieje
     if (!$blad) {
         if ($DB->GetOne('SELECT 1 FROM teleline WHERE UPPER(name) = ? ' . ($form['id'] ? 'AND id != ' . intval($form['id']) : '') . ' LIMIT 1;', array(strtoupper($form['name'])))) {
             $blad = true;
             $obj->script("addClassId('lineedit_name','alerts');");
             $obj->script("alert('Linia o podanej nazwie już istnieje.');");
         } else {
             $obj->script("removeClassId('lineedit_name','alerts');");
         }
     }
     // zapisujemy dane
     if (!$blad) {
         if ($form['id']) {
             $LMS->updateTeleLine($form);
         } else {
             $LMS->addTeleLine($form);
         }
         if (SYSLOG) {
             if ($form['id']) {
                 addlogs('Dodanie nowej linii telekomunikacyjnej ' . $form['name'], 'e=add;m=netdev;');
             } else {
                 addlogs('Aktualizacja linii telekomunikacyjnej ' . $form['name'], 'e=up;m=netdev;');
             }
         }
         $obj->assign("teleline_edit", "innerHTML", "");
         $obj->script("self.location.href='?m=teleline';");
     }
     return $obj;
 }
Beispiel #2
0
        $error['section'] = trans('Section name contains forbidden characters!');
    }
    if ($config['value'] == '') {
        if (!get_conf('phpui.config_empty_value')) {
            $error['value'] = trans('Option with empty value not allowed!');
        }
    } elseif ($msg = $LMS->CheckOption($config['name'], $config['value'])) {
        $error['value'] = $msg;
    }
    if (!isset($config['disabled'])) {
        $config['disabled'] = 0;
    }
    if (!$error) {
        $DB->Execute('INSERT INTO uiconfig (section, var, value, description, disabled) VALUES (?, ?, ?, ?, ?)', array($config['section'], $config['name'], $config['value'], $config['description'], $config['disabled']));
        if (SYSLOG) {
            addlogs('dodano zmienną konfiguracyjna, sekcja: ' . $config['section'] . ' zmienna: ' . $config['name'], 'e=add;m=conf;');
        }
        if (!isset($config['reuse'])) {
            $SESSION->redirect('?m=configlist');
        }
        unset($config['name']);
        unset($config['value']);
        unset($config['description']);
        unset($config['disabled']);
    }
}
$SESSION->save('backto', $_SERVER['QUERY_STRING']);
if (isset($_GET['section'])) {
    $config['section'] = $_GET['section'];
}
$SMARTY->assign('error', $error);
Beispiel #3
0
function GetSellerOrders($ebay_starttime, $ebay_endtime, $ebay_account, $type, $id)
{
    global $api_go, $oa, $user;
    global $dbConn, $mctime, $defaultstoreid;
    $pcount = 1;
    $errors = 1;
    do {
        echo "抓取....\t";
        $responseXml = $api_go->request($ebay_starttime, $ebay_endtime, $pcount);
        if (empty($responseXml)) {
            echo "Return Empty...Sleep 10 seconds..";
            sleep(10);
            $hasmore = true;
            continue;
        }
        //网络出现代理Proxy error 脚本休眠20秒
        $poxy_error_p = '#Proxy\\s*Error#i';
        if (preg_match($poxy_error_p, $responseXml)) {
            echo "Proxy Error...Sleep 20 seconds..";
            sleep(20);
            $hasmore = true;
            continue;
        }
        echo "\n";
        $responseDoc = new DomDocument();
        $responseDoc->loadXML($responseXml);
        //保存原始raw数据
        $raw_data_path = EBAY_RAW_DATA_PATH . $ebay_account . '/date_range_order/' . date('Y-m') . '/' . date('d') . '/';
        $raw_data_filename = str_replace(':', '-', $ebay_starttime) . '--' . str_replace(':', '-', $ebay_endtime) . '--p' . $pcount . '.xml';
        $raw_data_filename = $raw_data_path . $raw_data_filename;
        $save_res = save_ebay_raw_data($raw_data_filename, $responseXml);
        if ($save_res !== false) {
            echo "save raw data ok...\n";
        } else {
            echo "save raw data fail...\n";
        }
        $responseXml = null;
        unset($responseXml);
        $TotalNumberOfPages = $responseDoc->getElementsByTagName('TotalNumberOfPages')->item(0)->nodeValue;
        $TotalNumberOfEntries = $responseDoc->getElementsByTagName('TotalNumberOfEntries')->item(0)->nodeValue;
        $hasmore = $responseDoc->getElementsByTagName('HasMoreOrders')->item(0)->nodeValue;
        $Ack = $responseDoc->getElementsByTagName('Ack')->item(0)->nodeValue;
        echo "正在请求:{$pcount}/{$TotalNumberOfPages}\t记录数[ {$TotalNumberOfEntries} ]\t同步状态: {$Ack} 还有更多:{$hasmore}\n";
        if ($id == '' && $type == '1') {
            if ($Ack == 'Failure') {
                $ss = "insert into errors_ack(ebay_account,starttime,endtime,status,notes) \n\t\t\t\t\t\t\tvalues('{$ebay_account}','{$ebay_starttime}','{$ebay_endtime}','0','Ack False')";
                $dbConn->query($ss);
            }
        }
        if ($id > 0) {
            if ($Ack == 'Success' || $Ack == 'Warning') {
                $gg = "update errors_ack set status = 1 where id='{$id}' ";
            } else {
                $gg = "update errors_ack set status = 0 where id='{$id}' ";
            }
            $dbConn->query($gg);
        }
        /**/
        $log_name = '同步订单bygo';
        $log_operationtime = $mctime;
        $log_notes = $ebay_account . ":{$pcount}/{$TotalNumberOfPages} ,Ack={$Ack}";
        addlogs($log_name, $log_operationtime, 0, $log_notes, $user, $ebay_account, $ebay_starttime, $ebay_endtime, $type);
        /**/
        $SellerOrderArray = $responseDoc->getElementsByTagName('Order');
        //调用订单入库函数
        __handle_ebay_orderxml($SellerOrderArray, $ebay_account);
        $SellerOrderArray = null;
        unset($SellerOrderArray);
        if ($id == '' && $type == '1') {
            if ($Ack == '' || $Ack == 'Failure') {
                $ss = "insert into errors_ack(ebay_account,starttime,endtime,status,notes,currentpage) \n\t\t\t\t\t\t\tvalues('{$ebay_account}','{$ebay_starttime}','{$ebay_endtime}','0','Ack False','{$pcount}')";
                $dbConn->query($ss);
            }
        }
        if ($pcount >= $TotalNumberOfPages) {
            echo $hasmore . "程序退出了\n";
            break;
        }
        $pcount++;
        $hasmore = strtolower($hasmore) == 'true' ? true : false;
    } while ($hasmore);
}
Beispiel #4
0
 *
 *  Please, see the doc/AUTHORS for more information about authors!
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License Version 2 as
 *  published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */
$id = intval($_GET['id']);
if (isset($_GET['is_sure']) && $_GET['is_sure'] == 1 && $id) {
    if ($DB->GetOne('SELECT COUNT(*) FROM divisions', array($id)) != 1) {
        if (SYSLOG) {
            $tmp = $DB->getone('select name from divisions where id=? limit 1;', array($id));
            addlogs('skasowano firmę ' . $tmp, 'e=rm;m=conf;');
        }
        $DB->Execute('DELETE FROM divisions WHERE id=?', array($id));
        $DB->Execute('DELETE FROM numberplanassignments WHERE divisionid=?', array($id));
    }
}
$SESSION->redirect('?' . $SESSION->get('backto'));
Beispiel #5
0
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License Version 2 as
 *  published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id: v 1.00 2012/12/20 22:01:35 Sylwester Kondracki Exp $
 */
$layout['pagetitle'] = 'Lista pól numeracyjnych PSTN';
if (isset($_GET['access'])) {
    $access = strtolower($_GET['access']);
    if (!in_array($access, array('f', 't'))) {
        $access = 't';
    }
    $id = (int) $_GET['id'];
    $DB->Execute('UPDATE hv_pstnrange SET ussage=? WHERE id=? ;', array($access, $id));
    if (SYSLOG) {
        $tmp = $DB->getone('select description from hv_pstnrange where id =? limit 1;', array($id));
        addlogs(($access == 't' ? 'Włączono' : 'Wyłączono') . ' Numerację PSTN ' . $tmp, 'e=up;m=voip');
    }
}
$SMARTY->assign('pstn', $HIPERUS->GetPstnRangeList());
$SMARTY->Display('hv_pstnrangelist.html');
Beispiel #6
0
 function delTeleLine($id)
 {
     if (SYSLOG) {
         $nazwa = $this->DB->GetOne('SELECT name FROM teleline WHERE id = ? LIMIT 1;', array($id));
         addlogs('Usunięcie linii telekomunikacyjnej ' . $nazwa, 'e=del;m=netdev;');
     }
     $this->DB->BeginTrans();
     //$DB->Execute('UPDATE fiberlineassign SET fiberline=0 WHERE fiberline = ?;',array($id));
     $this->DB->Execute('UPDATE netlinks SET teleline=0 WHERE teleline = ?;', array($id));
     $this->DB->Execute('DELETE FROM teleline WHERE id=?;', array($id));
     $this->DB->CommitTrans();
 }
Beispiel #7
0
 *  it under the terms of the GNU General Public License Version 2 as
 *  published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */
$customerid = $_GET['id'];
if ($LMS->ContractorExists($customerid)) {
    $balance = $LMS->GetCustomerBalance($customerid);
    if ($balance < 0) {
        $DB->BeginTrans();
        $DB->Execute('INSERT INTO cash (time, type, userid, value, customerid, comment)
			VALUES (?NOW?, 1, ?, ?, ?, ?)', array($AUTH->id, str_replace(',', '.', $balance * -1), $customerid, trans('Accounted')));
        $DB->Execute('UPDATE documents SET closed = 1 
			WHERE customerid = ? AND type IN (?, ?) AND closed = 0', array($customerid, DOC_INVOICE, DOC_CNOTE));
        if (SYSLOG) {
            addlogs('rozliczono zobowiązania kontrahenta ' . $LMS->getcustomername($customerid), 'e=up;m=fin;c=' . $customerid . ';');
        }
        $DB->CommitTrans();
    }
}
header('Location: ?' . $SESSION->get('backto'));
Beispiel #8
0
            if ($DB->Execute('UPDATE nodes SET blockade = ? WHERE id = ? ;', array(intval($_POST['blockade']), $id))) {
                $result = TRUE;
            } else {
                $result = FALSE;
            }
        }
        break;
    case 'balance_ok':
        if ($DB->GetOne('SELECT 1 FROM customers WHERE deleted = 0 AND id = ? LIMIT 1;', array($idc))) {
            $balance = $LMS->GetCustomerBalance($idc);
            if ($balance < 0) {
                $DB->BeginTrans();
                $DB->Execute('INSERT INTO cash (time, type, userid, value, customerid, comment) VALUES (?NOW?, 1, ?, ?, ?, ?)', array($AUTH->id, str_replace(',', '.', $balance * -1), $idc, trans('Accounted')));
                $DB->Execute('UPDATE documents SET closed = 1 WHERE customerid = ? AND type IN (?, ?) AND closed = 0', array($idc, DOC_INVOICE, DOC_CNOTE));
                if (SYSLOG) {
                    addlogs('rozliczono zobowiązania klienta ' . $LMS->getcustomername($idc), 'e=up;m=fin;c=' . $idc . ';');
                }
                $DB->CommitTrans();
            }
            $result = true;
        } else {
            $result = false;
        }
        break;
}
if (is_null($result)) {
    die('null');
} elseif (is_string($result)) {
    die($result);
} elseif ($result == true) {
    die('true');
Beispiel #9
0
 function Auth(&$DB, &$SESSION)
 {
     $this->DB =& $DB;
     $this->SESSION =& $SESSION;
     //$this->_revision = preg_replace('/^.Revision: ([0-9.]+).*/', '\1', $this->_revision);
     $this->_revision = '';
     if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
         $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
     } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
         $ip = $_SERVER['HTTP_CLIENT_IP'];
     } else {
         $ip = $_SERVER['REMOTE_ADDR'];
     }
     $this->ip = str_replace('::ffff:', '', $ip);
     if (isset($_GET['override'])) {
         $loginform = $_GET['loginform'];
     } elseif (isset($_POST['loginform'])) {
         $loginform = $_POST['loginform'];
     }
     $this->SESSION->restore('session_login', $this->login);
     if ($this->login) {
         $this->islogged = TRUE;
     } elseif (isset($loginform)) {
         $this->login = $loginform['login'];
         $this->passwd = $loginform['pwd'];
         writesyslog('Login attempt by ' . $this->login, LOG_INFO);
     } elseif ($this->DB->GetOne('SELECT COUNT(id) FROM users') == 0) {
         $this->islogged = TRUE;
         $_GET['m'] = 'useradd';
         return TRUE;
     }
     if ($this->islogged || $this->login && $this->VerifyUser()) {
         $this->SESSION->restore('session_passwdrequiredchange', $this->passwdrequiredchange);
         if (empty($this->last)) {
             $this->SESSION->restore('session_last', $this->last);
             $this->SESSION->restore('session_lastip', $this->lastip);
         }
         $this->logname = $this->logname ? $this->logname : $this->SESSION->get('session_logname');
         $this->id = $this->id ? $this->id : $this->SESSION->get('session_id');
         $this->nomodules = $this->nomodules ? $this->nomodules : $this->SESSION->get('session_nomodules');
         if (isset($loginform)) {
             $this->DB->Execute('UPDATE users SET lastlogindate=?, lastloginip=? WHERE id=?', array(time(), $this->ip, $this->id));
             $this->DB->Execute('DELETE FROM cache WHERE id = ? ;', array($this->id));
             writesyslog('User ' . $this->login . ' logged in.', LOG_INFO);
             if (SYSLOG) {
                 addlogs('logowanie do systemu: ' . $this->login . ' IP: ' . $this->ip . ' ( ' . gethostbyaddr($this->ip) . ' ) ', 'e=add;m=admin;uid=' . $this->id);
             }
         }
         $this->SESSION->save('session_id', $this->id);
         $this->SESSION->save('session_login', $this->login);
         $this->SESSION->save('session_logname', $this->logname);
         $this->SESSION->save('session_last', $this->last);
         $this->SESSION->save('session_lastip', $this->lastip);
         $this->SESSION->save('session_nomodules', $this->nomodules);
     } else {
         if (isset($loginform)) {
             if ($this->id) {
                 if (!$this->hostverified) {
                     writesyslog('Bad host (' . $this->ip . ') for ' . $this->login, LOG_WARNING);
                 }
                 if (!$this->passverified) {
                     writesyslog('Bad password for ' . $this->login, LOG_WARNING);
                 }
                 $this->DB->Execute('UPDATE users SET failedlogindate=?, failedloginip=? WHERE id = ?', array(time(), $this->ip, $this->id));
             } else {
                 writesyslog('Unknown login ' . $this->login . ' from ' . $this->ip, LOG_WARNING);
             }
         }
         if (!$this->error) {
             $this->error = trans('Please login.');
         }
         $this->LogOut();
     }
 }
Beispiel #10
0
function setnodeblockade($idek)
{
    global $DB, $LMS;
    $obj = new xajaxResponse();
    $tmp = $DB->GetOne('SELECT blockade FROM nodes WHERE id = ? LIMIT 1 ;',array($idek));
    $tmp = intval($tmp);
    if ($tmp == 1) $tmp = 0 ; else $tmp = 1;
    
    if ($DB->Execute('UPDATE nodes SET blockade = ? WHERE id = ? ;',array($tmp,$idek)));
    $nodename = $LMS->GetNodeName($idek); 
    $customerid = $LMS->GetNodeOwner($idek); //pobiera ID właścieiela komputera
    $customername = $LMS->GetCustomerName($customerid); // pobiera Imię i Nazwisko właściiela komputera na podstawie ID
    if (SYSLOG) {
	addlogs(($tmp ? 'włączono' : 'wyłączono').' blokadę dla komputera'.$nodename.', Użytkownik: '.$customername.'','e=warn;m=node;n='.$idek.';c='.$customerid);
    }
    
    if ($tmp == 0) {
      $obj->script("document.getElementById('src_blockade".$idek."').src='img/padlockoff.png';");
    } else {
      $obj->script("document.getElementById('src_blockade".$idek."').src='img/padlock.png';");
    }
  
  return $obj;
}
Beispiel #11
0
                }
                if (!$error && ($limits[$limitidx] == 0 || $limits[$limitidx] <= $cnt)) {
                    $error['ownerid'] = trans('Exceeded \'$a\' accounts limit of selected customer ($b)!', $name, $limits[$limitidx]);
                }
            }
        }
    }
    if (!$error) {
        $DB->BeginTrans();
        $DB->Execute('INSERT INTO passwd (ownerid, login, password, home, expdate, domainid, 
				type, realname, quota_sh, quota_mail, quota_www, quota_ftp, quota_sql,
				mail_forward, mail_bcc, description) 
				VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array($account['ownerid'], $account['login'], crypt($account['passwd1']), $account['home'], $account['expdate'], $account['domainid'], $account['type'], $account['realname'], $quota['sh'], $quota['mail'], $quota['www'], $quota['ftp'], $quota['sql'], $account['mail_forward'], $account['mail_bcc'], $account['description']));
        $id = $DB->GetLastInsertId('passwd');
        if (SYSLOG) {
            addlogs('Dodano nowe konto ' . $account['login'], 'e=add;m=hosting;id=' . $id . ';c=' . $account['ownerid']);
        }
        $DB->Execute('UPDATE passwd SET uid = id + 2000 WHERE id = ?', array($id));
        $DB->CommitTrans();
        if (!isset($account['reuse'])) {
            $SESSION->redirect('?m=accountinfo&id=' . $id);
        }
        unset($account['login']);
        unset($account['home']);
        unset($account['realname']);
        unset($account['passwd1']);
        unset($account['passwd2']);
        unset($account['mail_forward']);
        unset($account['description']);
    }
    $SMARTY->assign('error', $error);
Beispiel #12
0
 * LMS version 1.11-git
 *
 *  (C) Copyright 2001-2012 LMS Developers
 *
 *  Please, see the doc/AUTHORS for more information about authors!
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License Version 2 as
 *  published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */
$id = $_GET['id'];
if ($id && $_GET['is_sure'] == '1') {
    if (SYSLOG) {
        $tmp = $DB->getrow('SELECT * FROM uiconfig WHERE id = ? LIMIT 1;', array($id));
        addlogs('skasowano zmienną konfiguracyjną, sekcja: ' . $tmp['section'] . ' zmienna: ' . $tmp['var'] . ' wartość: ' . $tmp['value'], 'e=rm;m=conf;');
    }
    $DB->Execute('DELETE FROM uiconfig WHERE id = ?', array($id));
}
header('Location: ?m=configlist');
Beispiel #13
0
            if (SYSLOG) {
                $tmp = $DB->getrow('select type,customerid from documents where id = ? LIMIT 1;', array($id));
                addlogs('skasowano dokument ' . $DOCTYPES[$tmp['type']], 'e=rm;mod=doc;c=' . $tmp['customerid']);
            }
            $DB->Execute('DELETE FROM documentcontents WHERE docid = ?', array($id));
            $DB->Execute('DELETE FROM documents WHERE id = ?', array($id));
            $DB->CommitTrans();
        }
    } elseif (isset($_GET['id'])) {
        $md5sum = $DB->GetOne('SELECT c.md5sum FROM documentcontents c
			JOIN documents d ON (d.id = c.docid)
			JOIN docrights r ON (r.doctype = d.type)
			WHERE c.docid = ? AND r.userid = ? AND (r.rights & 16) = 16', array($_GET['id'], $AUTH->id));
        if (!$md5sum) {
            $SMARTY->display('noaccess.html');
            die;
        }
        if ($DB->GetOne('SELECT COUNT(*) FROM documentcontents WHERE md5sum = ?', array((string) $md5sum)) == 1) {
            @unlink(DOC_DIR . '/' . substr($md5sum, 0, 2) . '/' . $md5sum);
        }
        $DB->BeginTrans();
        if (SYSLOG) {
            $tmp = $DB->getrow('select type,customerid from documents where id = ? LIMIT 1;', array($_GET['id']));
            addlogs('skasowano dokument ' . $DOCTYPES[$tmp['type']], 'e=rm;mod=doc;c=' . $tmp['customerid']);
        }
        $DB->Execute('DELETE FROM documentcontents WHERE docid = ?', array($_GET['id']));
        $DB->Execute('DELETE FROM documents WHERE id = ?', array($_GET['id']));
        $DB->CommitTrans();
    }
}
$SESSION->redirect('?' . $SESSION->get('backto'));
Beispiel #14
0
    $LMS->DelPost($_GET['postid']);
    $SESSION->redirect('?m=infocenter&tid=' . $tid . '&backto=' . $backto . ($cid ? '&cid=' . $cid : '') . ($nid ? '&nid=' . $nid : '') . ($netdevid ? '&netdevid=' . $netdevid : ''));
}
if ($action === 'deltopic' && $_GET['is_sure'] == '1') {
    $LMS->DelTopic($tid);
    $SESSION->redirect('?m=' . $backto . ($cid ? '&id=' . $cid : '') . ($nid ? '&id=' . $nid : '') . ($netdevid ? '&id=' . $netdevid : ''));
}
if ($action === 'editpost') {
    $SMARTY->assign('post', $DB->GetRow('SELECT * FROM info_center_post WHERE id=?', array($_GET['postid'])));
}
if ($action === 'reopen') {
    $DB->Execute('UPDATE info_center SET closed = ? WHERE id = ? ;', array(0, $tid));
    if (SYSLOG) {
        $tmp = $DB->getrow('SELECT cid, topic FROM info_center WHERE id=? ' . $DB->limit('1') . ' ;', array($tid));
        $cusname = $LMS->getcustomername($tmp['cid']);
        addlogs('Otwarto ponownie zgłoszenie ' . $tmp['topic'] . ' dla klienta ' . $cusname, 'e=up;m=cc;c=' . $tmp['cid'] . ';id=' . $tid . ';');
    }
    $SESSION->redirect('?m=' . $backto . ($tid ? '&tid=' . $tid : '') . ($cid ? '&cid=' . $cid : '') . ($nid ? '&nid=' . $nid : '') . ($netdevid ? '&netdevid=' . $netdevid : ''));
}
if (isset($_POST['infocenteraddpost'])) {
    $dane['cid'] = $cid;
    $dane['tid'] = $tid;
    $dane['post'] = $_POST['post'];
    $LMS->AddNewPostToTopic($dane);
    if (!$callback) {
        $SESSION->redirect('?m=infocenter&tid=' . $tid . '&backto=' . $backto . ($cid ? '&cid=' . $cid : '') . ($nid ? '&nid=' . $nid : '') . ($netdevid ? '&netdevid=' . $netdevid : ''));
    } else {
        $SESSION->redirect('?m=' . $backto . ($cid ? '&id=' . $cid : '') . ($nid ? '&id=' . $nid : '') . ($netdevid ? '&id=' . $netdevid : ''));
    }
}
if (isset($_POST['infocentereditpost'])) {
Beispiel #15
0
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */
$id = (int) $_GET['id'];
if ($id && $_GET['is_sure'] == '1') {
    $DB->BeginTrans();
    if (SYSLOG) {
        $tmp = $DB->GetOne('SELECT login FROM passwd WHERE id = ? LIMIT 1;', array($id));
        addlogs('Skasowano konto ' . $tmp, 'e=rm;m=hosting');
    }
    if ($DB->Execute('DELETE FROM passwd WHERE id = ?', array($id))) {
        // alias-account assignments...
        $DB->Execute('DELETE FROM aliasassignments WHERE accountid = ?', array($id));
        // ...and orphaned aliases
        $DB->Execute('DELETE FROM aliases 
			WHERE NOT EXISTS (SELECT 1 FROM aliasassignments 
				WHERE aliasid = aliases.id)');
    }
    $DB->CommitTrans();
}
header('Location: ?m=accountlist');
Beispiel #16
0
    			if(!@rename($file, $newfile))
    				$error['file'] = trans('Can\'t save file in "$a" directory!', $path);
    		}
    		else
    			$error['file'] = trans('Specified file exists in database!');
    	}
    */
    $documentedit['closed'] = isset($documentedit['closed']) ? 1 : 0;
    if (!$error) {
        $DB->BeginTrans();
        $fullnumber = docnumber($documentedit['number'], $DB->GetOne('SELECT template FROM numberplans WHERE id = ?', array($documentedit['numberplanid'])), $document['cdate']);
        $DB->Execute('UPDATE documents SET type=?, closed=?, number=?, numberplanid=?, fullnumber=? 
				WHERE id=?', array($documentedit['type'], $documentedit['closed'], $documentedit['number'], $documentedit['numberplanid'], $fullnumber ? $fullnumber : NULL, $documentedit['id']));
        if (SYSLOG) {
            $tmp = $DB->getone('select customerid from documents where id =? limit 1', array($documentedit['id']));
            addlogs('aktualizacja dokumentu ' . $DOCTYPES[$documentedit['type']], 'e=up;m=doc;c=' . $tmp);
        }
        $DB->Execute('UPDATE documentcontents SET title=?, fromdate=?, todate=?, description=?
				WHERE docid=?', array($documentedit['title'], $documentedit['fromdate'], $documentedit['todate'], $documentedit['description'], $documentedit['id']));
        $DB->CommitTrans();
        $SESSION->redirect('?' . $SESSION->get('backto'));
    } else {
        $document['title'] = $documentedit['title'];
        $document['type'] = $documentedit['type'];
        $document['description'] = $documentedit['description'];
        $document['closed'] = $documentedit['closed'];
        $document['number'] = $documentedit['number'];
        $document['numberplanid'] = $documentedit['numberplanid'];
        $document['fromdate'] = $oldfdate;
        $document['todate'] = $oldtdate;
    }
Beispiel #17
0
        }
    }
    $tarifflist['total'] = sizeof($tarifflist);
    $tarifflist['totalincome'] = $totalincome;
    $tarifflist['totalcustomers'] = $totalcustomers;
    $tarifflist['totalcount'] = $totalcount;
    $tarifflist['totalactivecount'] = $totalactivecount;
    $tarifflist['order'] = $order;
    $tarifflist['direction'] = $direction;
    return $tarifflist;
}
if (isset($_GET['setactive'])) {
    $DB->Execute('UPDATE tariffs SET active=? WHERE id=? ;', array($_GET['setactive'], $_GET['id']));
    if (SYSLOG) {
        $tmp = $DB->GetOne('SELECT name FROM tariffs WHERE id=? ' . $DB->limit('1') . ' ;', array($_GET['id']));
        addlogs(($_GET['setactive'] ? 'włączono' : 'wyłączono') . ' taryfę ' . $tmp, 'e=up;m=tariff;');
    }
}
if (!isset($_GET['o'])) {
    $SESSION->restore('tlo', $o);
} else {
    $o = $_GET['o'];
}
$SESSION->save('tlo', $o);
if (!isset($_GET['t'])) {
    $SESSION->restore('tlt', $t);
} else {
    $t = $_GET['t'];
}
$SESSION->save('tlt', $t);
if (!isset($_GET['g'])) {
Beispiel #18
0
    if ($division['regon'] != '' && !check_regon($division['regon'])) {
        $error['regon'] = trans('Incorrect Business Registration Number!');
    }
    if ($division['account'] != '' && (strlen($division['account']) > 48 || !preg_match('/^([A-Z][A-Z])?[0-9]+$/', $division['account']))) {
        $error['account'] = trans('Wrong account number!');
    }
    if ($division['inv_paytime'] == '') {
        $division['inv_paytime'] = NULL;
    }
    if (!$error) {
        $DB->Execute('INSERT INTO divisions (name, shortname, address, city, zip,
			countryid, ten, regon, account, inv_header, inv_footer, inv_author,
			inv_cplace, inv_paytime, inv_paytype, description, status, url, email, rpt, rjpt, rbe, urllogofile) 
			VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array($division['name'], $division['shortname'], $division['address'], $division['city'], $division['zip'], $division['countryid'], $division['ten'], $division['regon'], $division['account'], $division['inv_header'], $division['inv_footer'], $division['inv_author'], $division['inv_cplace'], $division['inv_paytime'], $division['inv_paytype'] ? $division['inv_paytype'] : NULL, $division['description'], !empty($division['status']) ? 1 : 0, $division['url'] ? $division['url'] : NULL, $division['email'] ? $division['email'] : NULL, $division['rpt'] ? $division['rpt'] : NULL, $division['rjpt'] ? $division['rjpt'] : NULL, $division['rbe'] ? $division['rbe'] : NULL, $division['urllogofile'] ? $division['urllogofile'] : ''));
        if (SYSLOG) {
            addlogs('dodano nową firmę: ' . $division['name'], 'e=add;m=conf;');
        }
        if (!isset($division['reuse'])) {
            $SESSION->redirect('?m=divisionlist');
        }
    }
}
if (!isset($division['zip']) && isset($CONFIG['phpui']['default_zip'])) {
    $division['zip'] = $CONFIG['phpui']['default_zip'];
}
if (!isset($division['city']) && isset($CONFIG['phpui']['default_city'])) {
    $division['city'] = $CONFIG['phpui']['default_city'];
}
if (!isset($division['address']) && isset($CONFIG['phpui']['default_address'])) {
    $division['address'] = $CONFIG['phpui']['default_address'];
}
Beispiel #19
0
        $invoice['sdateview'] = $old['sdateview'];
        //get_conf('invoices.sdateview');
        $invoice['urllogofile'] = $old['urllogofile'];
        //get_conf('invoices.urllogofile');
        if (empty($division['inv_author'])) {
            $division['inv_author'] = $DB->GetOne('SELECT name FROM users WHERE id = ? LIMIT 1;', array($tis->AUTH->id));
        }
        $DB->Execute('INSERT INTO documents (type, number, numberplanid, extnumber, cdate, sdate, customerid, userid, divisionid, name, 
			address, zip, city, countryid, ten, ssn, paytime, paytype, closed, reference, reason,
			sale, div_name, div_address, div_city, div_zip, div_countryid, div_ten, div_regon,
			div_account, div_inv_header, div_inv_footer, div_inv_author, div_inv_cplace, div_shortname, fullnumber,
			version, templatetype, templatefile, sdateview, urllogofile, print_balance_info) 
			VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ;', array(DOC_INVOICE, $invoice['number'], $invoice['numberplanid'], $old['extnumber'], $invoice['cdate'], $invoice['sdate'], $old['customerid'], $AUTH->id, $old['divisionid'], $old['name'], $old['address'], $old['zip'], $old['city'], $old['countryid'], $old['ten'], $old['ssn'], $invoice['paytime'], $invoice['paytype'], 0, $old['reference'], $old['reason'], $old['sale'], $old['div_name'], $old['div_address'], $old['div_city'], $old['div_zip'], $old['div_countryid'], $old['div_ten'], $old['div_regon'], $old['div_account'], $old['div_inv_header'], $old['div_inv_footer'], $old['div_inv_author'], $old['div_inv_cplace'], $old['div_shortname'], $fullnumber, $invoice['version'] ? $invoice['version'] : '', $invoice['templatetype'] ? $invoice['templatetype'] : '', $invoice['templatefile'] ? $invoice['templatefile'] : '', $invoice['sdateview'] ? 1 : 0, $invoice['urllogofile'] ? $invoice['urllogofile'] : '', get_conf('invoices.print_balance_info', '1')));
        $newid = $DB->GetLastInsertId('documents');
        if (SYSLOG) {
            addlogs('konwersja faktury Proforma ' . $LMS->getdocumentnumber($docid) . ' na fakutrę ' . $LMS->getdocumentnumber($newid), 'e=up;m=fin;c=' . $old['customerid']);
        }
        $old = $DB->GetAll('SELECT * FROM invoicecontents WHERE docid = ?', array($docid));
        for ($i = 0; $i < sizeof($old); $i++) {
            $DB->Execute('INSERT INTO invoicecontents (docid, itemid, value, pdiscount, vdiscount, taxid, prodid, content, count, description, tariffid) 
			VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ;', array($newid, $old[$i]['itemid'], $old[$i]['value'], $old[$i]['pdiscount'], $old[$i]['vdiscount'], $old[$i]['taxid'], $old[$i]['prodid'], $old[$i]['content'], $old[$i]['count'], $old[$i]['description'], $old[$i]['tariffid']));
        }
        $DB->Execute('UPDATE cash SET time = ? , docid = ? WHERE docid = ?', array($invoice['cdate'], $newid, $docid));
        $DB->Execute('UPDATE documents SET closed = ?, reference = ? WHERE id = ? ;', array(1, $newid, $docid));
        $DB->UnLockTables();
        $DB->CommitTrans();
        if ($parents == 'customerinfo') {
            $SESSION->redirect("?m=customerinfo&id=" . $cid);
        } else {
            $SESSION->redirect("?m=invoicelist");
        }
Beispiel #20
0
    $SESSION->_saveSession();
    $SMARTY->assign('adlink', '&tuck=' . $tuck);
    $SMARTY->assign('start', $start);
    $SMARTY->assign('page', $page);
    $SMARTY->assign('pagelimit', $pagelimit);
    $SMARTY->assign('listdata', $listdata);
    $SMARTY->assign('filtr', $filtr);
    $SMARTY->assign('lista', $lista);
    $SMARTY->assign('tuck', $tuck);
    $SMARTY->display('cashimportlist_box.html');
    die;
} elseif ($tuck == 'duplicate') {
    if (isset($_GET['odksieguj']) && isset($_GET['idw']) && isset($_GET['idc']) && intval($_GET['idw']) && intval($_GET['idc'])) {
        if (SYSLOG) {
            $info = $DB->GetRow('SELECT * FROM cash WHERE id = ? LIMIT 1;', array(intval($_GET['idw'])));
            addlogs('usunięto zduplikowaną wpłatę z importu na kwotę :' . moneyf($info['value']) . ' z dnia: ' . date('Y/m/d', $info['time']) . ' dla ' . $LMS->GetCustomerName($info['customerid']), 'e=rm;m=fin;c=' . $info['customerid']);
        }
        $DB->Execute('DELETE FROM cash WHERE id = ? AND customerid = ? ;', array(intval($_GET['idw']), intval($_GET['idc'])));
    }
    if (!isset($_GET['o'])) {
        $SESSION->restore('cil_' . $tuck . '_o', $o);
    } else {
        $o = $_GET['o'];
    }
    $SESSION->save('cil_' . $tuck . '_o', $o);
    if (isset($_GET['cid'])) {
        $cid = $_GET['cid'];
    } else {
        $SESSION->restore('cil_' . $tuck . '_cid', $cid);
    }
    $SESSION->save('cil_' . $tuck . '_cid', $cid);
Beispiel #21
0
            unset($a['settlement']);
        }
        //					!empty($a['invoice']) ? $a['invoice'] : 0,
        //					isset($a['invoice']) ? 1 : 0,
        $DB->Execute('UPDATE assignments SET tariffid=?, customerid=?, period=?, at=?,
			invoice=?, settlement=?, datefrom=?, dateto=?, pdiscount=?, vdiscount=?,
			liabilityid=?, numberplanid=?, paytype=?
			WHERE id=?', array(intval($a['tariffid']), $customer['id'], $period, $at, !empty($a['invoice']) ? $a['invoice'] : 0, isset($a['settlement']) ? 1 : 0, $from, $to, str_replace(',', '.', $a['pdiscount']), str_replace(',', '.', $a['vdiscount']), $a['liabilityid'], !empty($a['numberplanid']) ? $a['numberplanid'] : NULL, !empty($a['paytype']) ? $a['paytype'] : NULL, $a['id']));
        $DB->Execute('DELETE FROM nodeassignments WHERE assignmentid=?', array($a['id']));
        if (isset($a['nodes']) && sizeof($a['nodes'])) {
            foreach ($a['nodes'] as $nodeid) {
                $DB->Execute('INSERT INTO nodeassignments (nodeid, assignmentid) VALUES (?,?)', array($nodeid, $a['id']));
            }
        }
        if (SYSLOG) {
            addlogs('aktualizacja zobowiązania dla klienta ' . $LMS->getcustomername($customer['id']) . ', taryfa: ' . $DB->getone('select name from tariffs where id=? limit 1;', array(intval($a['tariffid']))), 'e=up;m=cus;c=' . $customer['id'] . ';');
        }
        $DB->CommitTrans();
        $SESSION->redirect('?' . $SESSION->get('backto'));
    }
    $SMARTY->assign('error', $error);
} else {
    $a = $DB->GetRow('SELECT a.id AS id, a.customerid, a.tariffid, a.period,
				a.at, a.datefrom, a.dateto, a.numberplanid, a.paytype,
				a.invoice, a.settlement, a.pdiscount, a.vdiscount, a.liabilityid, 
				(CASE liabilityid WHEN 0 THEN tariffs.name ELSE liabilities.name END) AS name, 
				liabilities.value AS value, liabilities.prodid AS prodid, liabilities.taxid AS taxid
				FROM assignments a
				LEFT JOIN tariffs ON (tariffs.id = a.tariffid)
				LEFT JOIN liabilities ON (liabilities.id = a.liabilityid)
				WHERE a.id = ?', array($_GET['id']));
Beispiel #22
0
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */
$customerid = intval($_GET['customerid']);
if (!$LMS->CustomerExists($customerid)) {
    $SESSION->redirect('?m=customerlist');
}
if (isset($_GET['cutoffstop'])) {
    if (!intval($_GET['cutoffstop'])) {
        $cutoffstop = 0;
    } else {
        $cutoffstop = mktime(23, 59, 59, date('m'), date('d') + intval($_GET['cutoffstop']));
    }
    // excluded groups check
    if (!$DB->GetOne('SELECT 1 FROM customerassignments a
	                JOIN excludedgroups e ON (a.customergroupid = e.customergroupid)
			WHERE e.userid = lms_current_user() AND a.customerid = ?', array($customerid))) {
        $DB->Execute('UPDATE customers SET cutoffstop = ? WHERE id = ?', array($cutoffstop, $customerid));
        if (SYSLOG) {
            addlogs(($cutoffstop ? 'włączono' : 'wyłączono') . ' zawieszenie blokowania dla klienta ' . $LMS->getcustomername($customerid), 'e=up;m=cus;c=' . $customerid . ';');
        }
    }
}
$SESSION->redirect('?' . $SESSION->get('backto'));
Beispiel #23
0
    }
}
// end if db backup
/************************************************
*             KATALOGI                          *
************************************************/
if (get_conf('autobackup.dir_ftpsend') && get_conf('autobackup.dir_local', '') != '' && $FTP->connect($ssl)) {
    $ftp_dirs = explode(',', get_conf('autobackup.dir_ftp'));
    $local_dirs = explode(',', get_conf('autobackup.dir_local'));
    for ($j = 0; $j < sizeof($ftp_dirs); $j++) {
        $FTP->chdir("/");
        $tmpdir = explode("/", $ftp_dirs[$j]);
        if (sizeof($tmpdir) > 1) {
            $tmp = '/';
            for ($i = 1; $i < sizeof($tmpdir); $i++) {
                $tmp .= $tmpdir[$i] . '/';
                $FTP->chdir($tmp, true);
            }
        }
        $result = $FTP->mirror($local_dirs[$j] . '/', $ftp_dirs[$j] . '/', $akcja);
        if (SYSLOG) {
            if ($result) {
                addlogs('lms-autobackup -> Utworzono kopię katalogu ' . $local_dirs[$j] . ' na serwerze FTP: ' . get_conf('autobackup.ftphost'), 'e=add;m=admin;');
            } else {
                addlogs('lms-autobackup -> Nie utworzono kopii katalogu ' . $local_dirs[$j] . ' na serwerze FTP: ' . get_conf('autobackup.ftphost'), 'e=err;m=admin;');
            }
        }
    }
    $FTP->close();
    print_r($DB->errors);
}
Beispiel #24
0
        $netdevdata['distribution_layer'] = $netdevdata['access_layer'] = 1;
    }
    //	$netdevdata['name'] = (str_replace(" ","_",$netdevdata['name']));
    if (!$netdevdata['devtype']) {
        $netdevdata['managed'] = NIE;
    }
    $DB->LockTables('netdevices');
    if (!isset($netdevdata['name']) || empty($netdevdata['name'])) {
        $maxnr = $DB->getOne('SELECT MAX(id) FROM netdevices');
        $maxnr++;
        $netdevdata['name'] = 'INT_' . sprintf('%04.d', $maxnr);
    }
    $netdevid = $LMS->NetDevAdd($netdevdata);
    $DB->UnlockTables();
    if (SYSLOG) {
        addlogs('Dodano nowy interfejs sieciowy ' . $netdevdata['name'], 'e=add;m=netdev;');
    }
    $SESSION->redirect('?m=netdevinfo&id=' . $netdevid);
} else {
    $netdev = array('devtype' => DEV_ACTIVE, 'managed' => TAK, 'sharing' => NIE, 'modular' => NIE, 'backbone_layer' => NIE, 'distribution_layer' => TAK, 'access_layer' => TAK);
}
$layout['pagetitle'] = 'Nowe urządzenie sieciowe';
$SMARTY->assign('networknodelist', $LMS->GetListnetworknode());
$annex_info = array('section' => 'netdev', 'ownerid' => 0);
$SMARTY->assign('annex_info', $annex_info);
include MODULES_DIR . '/netdevxajax.inc.php';
if (chkconfig($CONFIG['phpui']['ewx_support'])) {
    $SMARTY->assign('channels', $DB->GetAll('SELECT id, name FROM ewx_channels ORDER BY name'));
}
$SMARTY->assign('action', 'add');
$SMARTY->assign('netdevinfo', $netdev);
Beispiel #25
0
    }
    if (($cfg['var'] != $config['var'] || $cfg['section'] != $config['section']) && $LMS->GetConfigOptionId($cfg['var'], $cfg['section'])) {
        $error['var'] = trans('Option exists!');
    }
    if (!preg_match('/^[a-z0-9_-]+$/', $cfg['section']) && $cfg['section'] != '') {
        $error['section'] = trans('Section name contains forbidden characters!');
    }
    if ($cfg['value'] == '') {
        if (!get_conf('phpui.config_empty_value')) {
            $error['value'] = trans('Empty option value is not allowed!');
        }
    } elseif ($msg = $LMS->CheckOption($cfg['var'], $cfg['value'])) {
        $error['value'] = $msg;
    }
    if (!isset($cfg['disabled'])) {
        $cfg['disabled'] = 0;
    }
    if (!$error) {
        $DB->Execute('UPDATE uiconfig SET section = ?, var = ?, value = ?, description = ?, disabled = ? WHERE id = ?', array($cfg['section'], $cfg['var'], $cfg['value'], $cfg['description'], $cfg['disabled'], $cfg['id']));
        if (SYSLOG) {
            addlogs('aktualizacja zmiennej, sekcja: ' . $cfg['section'] . ' , zmienna: ' . $cfg['var'], 'e=up;m=conf;');
        }
        $SESSION->redirect('?m=configlist');
    }
    $config = $cfg;
}
$layout['pagetitle'] = trans('Option Edit: $a', $option);
$SESSION->save('backto', $_SERVER['QUERY_STRING']);
$SMARTY->assign('error', $error);
$SMARTY->assign('config', $config);
$SMARTY->display('configedit.html');
Beispiel #26
0
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */
if (isset($_GET['is_sure'])) {
    $basename = 'iNET-lms-' . $_GET['db'];
    if (@file_exists($CONFIG['directories']['backup_dir'] . '/' . $basename . '.sql')) {
        if (@unlink($CONFIG['directories']['backup_dir'] . '/' . $basename . '.sql') && SYSLOG) {
            addlogs('skasowano archiwum bazy: ' . $CONFIG['directories']['backup_dir'] . '/' . $basename . '.sql', 'e=rm;m=admin;');
        }
    } elseif (extension_loaded('zlib') && @file_exists($CONFIG['directories']['backup_dir'] . '/' . $basename . '.sql.gz')) {
        if (@unlink($CONFIG['directories']['backup_dir'] . '/' . $basename . '.sql.gz') && SYSLOG) {
            addlogs('skasowano archiwum bazy: ' . $CONFIG['directories']['backup_dir'] . '/' . $basename . '.sql.gz', 'e=rm;m=admin;');
        }
    }
    $SESSION->redirect('?m=dblist');
} else {
    $layout['pagetitle'] = trans('Backup Delete');
    $SMARTY->display('header.html');
    echo '<H1>' . trans('Deletion of Database Backup') . '</H1>';
    echo '<P>' . trans('Are you sure, you want to delete database backup created at $a ?', date('Y/m/d H:i.s', $_GET['db'])) . '</P>';
    echo '<a href="?m=dbdel&db=' . $_GET['db'] . '&is_sure=1">' . trans('Yes, I am sure.') . '</A>';
    $SMARTY->display('footer.html');
}
Beispiel #27
0
    if (!$error) {
        $customer = $LMS->GetCustomer($document['customerid']);
        $time = time();
        $DB->BeginTrans();
        $division = $DB->GetRow('SELECT name, shortname, address, city, zip, countryid, ten, regon,
				account, inv_header, inv_footer, inv_author, inv_cplace 
				FROM divisions WHERE id = ? ;', array($customer['divisionid']));
        $fullnumber = docnumber($document['number'], $DB->GetOne('SELECT template FROM numberplans WHERE id = ?', array($document['numberplanid'])), $time);
        $DB->Execute('INSERT INTO documents (type, number, numberplanid, cdate, 
			customerid, userid, name, address, zip, city, ten, ssn, divisionid, 
			div_name, div_shortname, div_address, div_city, div_zip, div_countryid, div_ten, div_regon,
			div_account, div_inv_header, div_inv_footer, div_inv_author, div_inv_cplace,closed, fullnumber)
			VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array($document['type'], $document['number'], $document['numberplanid'], $time, $document['customerid'], $AUTH->id, trim($customer['lastname'] . ' ' . $customer['name']), $customer['address'] ? $customer['address'] : '', $customer['zip'] ? $customer['zip'] : '', $customer['city'] ? $customer['city'] : '', $customer['ten'] ? $customer['ten'] : '', $customer['ssn'] ? $customer['ssn'] : '', $customer['divisionid'], $division['name'] ? $division['name'] : '', $division['shortname'] ? $division['shortname'] : '', $division['address'] ? $division['address'] : '', $division['city'] ? $division['city'] : '', $division['zip'] ? $division['zip'] : '', $division['countryid'] ? $division['countryid'] : 0, $division['ten'] ? $division['ten'] : '', $division['regon'] ? $division['regon'] : '', $division['account'] ? $division['account'] : '', $division['inv_header'] ? $division['inv_header'] : '', $division['inv_footer'] ? $division['inv_footer'] : '', $division['inv_author'] ? $division['inv_author'] : '', $division['inv_cplace'] ? $division['inv_cplace'] : '', isset($document['closed']) ? 1 : 0, $fullnumber ? $fullnumber : NULL));
        $docid = $DB->GetLastInsertID('documents');
        if (SYSLOG) {
            addlogs('dodano nowy dokument ' . $DOCTYPES[$document['type']], 'e=add;m=doc;c=' . $document['customerid']);
        }
        $DB->Execute('INSERT INTO documentcontents (docid, title, fromdate, todate, filename, contenttype, md5sum, description)
			VALUES (?, ?, ?, ?, ?, ?, ?, ?)', array($docid, $document['title'], $document['fromdate'], $document['todate'], $document['filename'], $document['contenttype'], $document['md5sum'], $document['description']));
        // template post-action
        if (!empty($engine['post-action']) && file_exists(DOC_DIR . '/templates/' . $engine['name'] . '/' . $engine['post-action'] . '.php')) {
            include DOC_DIR . '/templates/' . $engine['name'] . '/' . $engine['post-action'] . '.php';
        }
        $DB->CommitTrans();
        if (!isset($document['reuse'])) {
            if (isset($_GET['print'])) {
                $SESSION->save('documentprint', $docid);
            }
            $SESSION->redirect('?m=documentlist&c=' . $document['customerid']);
        }
        unset($document['title']);
Beispiel #28
0
 */
$id = intval($_GET['id']);
// LEFT join with domains for backward compat.
$account = $DB->GetRow('SELECT p.id, p.login, d.name AS domain 
		FROM passwd p
		LEFT JOIN domains d ON (p.domainid = d.id)
		WHERE p.id = ?', array($id));
if (!$account) {
    $SESSION->redirect('?' . $SESSION->get('backto'));
}
if (isset($_POST['passwd'])) {
    $account['passwd1'] = $_POST['passwd']['passwd'];
    $account['passwd2'] = $_POST['passwd']['confirm'];
    if ($account['passwd1'] != $account['passwd2']) {
        $error['passwd'] = trans('Passwords does not match!');
    } elseif ($account['passwd1'] == '') {
        $error['passwd'] = trans('Empty passwords are not allowed!');
    }
    if (!$error) {
        $DB->Execute('UPDATE passwd SET password = ? WHERE id = ?', array(crypt($account['passwd1']), $id));
        if (SYSLOG) {
            $tmp = $DB->getrow('select login,ownerid from passwd where id=? limit 1;', array($id));
            addlogs('zmiana hasła dla konta ' . $tmp['login'], 'e=up;m=hosting;id=' . $id . 'c=' . $tmp['ownerid'] . ';');
        }
        $SESSION->redirect('?' . $SESSION->get('backto'));
    }
}
$layout['pagetitle'] = trans('Password Change for Account: $a', $account['login'] . '@' . $account['domain']);
$SMARTY->assign('error', $error);
$SMARTY->assign('account', $account);
$SMARTY->display('accountpasswd.html');
Beispiel #29
0
function delete_model($id)
{
    global $DB;
    $obj = new xajaxResponse();
    if (SYSLOG) {
        $oldname = $DB->getOne('SELECT name FROM netdevicemodels WHERE id = ? ' . $DB->Limit(1) . ';', array($id));
        $pidname = $DB->getRow('SELECT p.id, p.name FROM netdevicemodels m JOIN netdeviceproducers p ON (p.id = m.netdeviceproducerid) WHERE m.id = ? ' . $DB->Limit(1) . ';', array($id));
        addlogs('Słownik Producenci: Producent -> ' . $pidname['name'] . ', usunięcie modelu ' . $oldname, 'm=other;e=del;');
    }
    $DB->BeginTrans();
    $DB->Execute('DELETE FROM netdevicemodels WHERE id = ? ;', array($id));
    $DB->CommitTrans();
    $obj->script("self.location.href='?m=netdevicemodels&page=1&p_id=" . $pidname['id'] . "';");
    return $obj;
}
Beispiel #30
0
    if ($division['ten'] != '' && !check_ten($division['ten']) && !isset($division['tenwarning'])) {
        $error['ten'] = trans('Incorrect Tax Exempt Number! If you are sure you want to accept it, then click "Submit" again.');
        $division['tenwarning'] = 1;
    }
    if ($division['regon'] != '' && !check_regon($division['regon'])) {
        $error['regon'] = trans('Incorrect Business Registration Number!');
    }
    if ($division['account'] != '' && (strlen($division['account']) > 48 || !preg_match('/^([A-Z][A-Z])?[0-9]+$/', $division['account']))) {
        $error['account'] = trans('Wrong account number!');
    }
    if ($division['inv_paytime'] == '') {
        $division['inv_paytime'] = NULL;
    }
    if (!$error) {
        $DB->Execute('UPDATE divisions SET name=?, shortname=?, address=?, 
			city=?, zip=?, countryid=?, ten=?, regon=?, account=?, inv_header=?, 
			inv_footer=?, inv_author=?, inv_cplace=?, inv_paytime=?,
			inv_paytype=?, description=?, status=?, url=?, email=?, rpt=?, rjpt=?, rbe=?, urllogofile=? 
			WHERE id=?', array($division['name'], $division['shortname'], $division['address'], $division['city'], $division['zip'], $division['countryid'], $division['ten'], $division['regon'], $division['account'], $division['inv_header'], $division['inv_footer'], $division['inv_author'], $division['inv_cplace'], $division['inv_paytime'], $division['inv_paytype'] ? $division['inv_paytype'] : null, $division['description'], !empty($division['status']) ? 1 : 0, $division['url'] ? $division['url'] : NULL, $division['email'] ? $division['email'] : NULL, $division['rpt'] ? $division['rpt'] : NULL, $division['rjpt'] ? $division['rjpt'] : NULL, $division['rbe'] ? $division['rbe'] : NULL, $division['urllogofile'] ? $division['urllogofile'] : '', $division['id']));
        if (SYSLOG) {
            addlogs('aktualizacja danych dla firmy ' . $division['name'], 'e=up;m=conf;');
        }
        $SESSION->redirect('?m=divisionlist');
    }
}
$layout['pagetitle'] = trans('Edit Division: $a', $olddiv['shortname']);
$SESSION->save('backto', $_SERVER['QUERY_STRING']);
$SMARTY->assign('division', !empty($division) ? $division : $olddiv);
$SMARTY->assign('countries', $LMS->GetCountries());
$SMARTY->assign('error', $error);
$SMARTY->display('divisionedit.html');