Revize 572
Přidáno uživatelem Roman Ševčík před téměř 15 roky(ů)
freenetis/trunk/kohana/media/download/hkfree.org | ||
---|---|---|
$ORIGIN kocourkov.hkfree.org.
|
||
$TTL 86400 ; (1 day)
|
||
kocourkov.hkfree.org. IN SOA charon.hkfree.org. pmv.root.hkfree.org. (
|
||
2009121400 ; serial
|
||
28800 ; refresh (8 hours)
|
||
7200 ; retry (2 hours)
|
||
604800 ; expire (1 week)
|
||
86400 ; minimum (1 day)
|
||
)
|
||
NS ns.hkfree.org.
|
||
NS ns2.hkfree.org.
|
||
MX 10 relay.hkfree.org.
|
||
|
||
|
||
A 10.107.37.1
|
||
pepa2 A 10.107.37.95
|
||
pepa A 10.107.37.101
|
||
pepa A 10.107.37.102
|
||
A 10.107.37.129
|
||
pepa2 A 10.107.37.130
|
||
karel A 10.107.37.150
|
||
karel A 10.107.37.151
|
||
A 10.107.137.1
|
||
A 10.107.137.129
|
||
freenetis/trunk/kohana/media/download/mac_restriction.sh | ||
---|---|---|
#!/bin/sh
|
||
iptables -F FORWARD
|
||
|
||
#pepa
|
||
iptables -I FORWARD -m mac --mac-source 00:00:00:00:11:22 -j REJECT
|
||
iptables -I FORWARD -s 10.107.37.102 -m mac --mac-source 00:00:00:00:11:22 -j ACCEPT
|
||
|
||
#pepa2
|
||
iptables -I FORWARD -m mac --mac-source 00:00:00:00:11:23 -j REJECT
|
||
iptables -I FORWARD -s 10.107.37.95 -m mac --mac-source 00:00:00:00:11:23 -j ACCEPT
|
||
|
||
#pepa
|
||
iptables -I FORWARD -m mac --mac-source 12:34:56:78:9a:bc -j REJECT
|
||
iptables -I FORWARD -s 10.107.37.101 -m mac --mac-source 12:34:56:78:9a:bc -j ACCEPT
|
||
|
||
freenetis/trunk/kohana/media/download/download.php | ||
---|---|---|
<?php
|
||
$file = urldecode ($_GET['file']);
|
||
$path_parts = pathinfo ($file);
|
||
|
||
header("Content-Disposition: attachment; filename=" . urlencode($path_parts['basename']));
|
||
header("Content-Type: application/force-download");
|
||
header("Content-Type: application/octet-stream");
|
||
header("Content-Type: application/download");
|
||
header("Content-Description: File Transfer");
|
||
header("Content-Length: " . filesize($file));
|
||
|
||
readfile($file);
|
||
?>
|
freenetis/trunk/kohana/media/download/dhcpd.conf | ||
---|---|---|
boot-unknown-clients false;
|
||
one-lease-per-client true;
|
||
default-lease-time 2400;
|
||
max-lease-time 7200;
|
||
option domain-name-servers 10.107.4.100, 10.107.4.129, 10.107.3.1;
|
||
option domain-name "hkfree.org";
|
||
authoritative;
|
||
|
||
subnet 10.107.37.0 netmask 255.255.255.128 {
|
||
option routers 10.107.37.1;
|
||
option broadcast-address 10.107.37.127;
|
||
group {
|
||
host pepa2-1 {
|
||
hardware ethernet 00:00:00:00:11:23;
|
||
fixed-address 10.107.37.95;
|
||
}
|
||
host pepa-2 {
|
||
hardware ethernet 12:34:56:78:9a:bc;
|
||
fixed-address 10.107.37.101;
|
||
}
|
||
host pepa-3 {
|
||
hardware ethernet 00:00:00:00:11:22;
|
||
fixed-address 10.107.37.102;
|
||
}
|
||
}
|
||
}
|
||
|
||
freenetis/trunk/kohana/media/download/10.107 | ||
---|---|---|
$ORIGIN .
|
||
$TTL 86400 ; (1 day)
|
||
37.107.10.in-addr.arpa IN SOA charon.hkfree.org. pmv.root.hkfree.org. (
|
||
2009121200 ; serial
|
||
28800 ; refresh (8 hours)
|
||
7200 ; retry (2 hours)
|
||
604800 ; expire (1 week)
|
||
86400 ; minimum (1 day)
|
||
)
|
||
NS ns.hkfree.org.
|
||
NS ns2.hkfree.org.
|
||
$ORIGIN 37.107.10.in-addr.arpa.
|
||
$TTL 86400
|
||
|
||
1 PTR kocourkov.hkfree.org.
|
||
101 PTR pepa.kocourkov.hkfree.org.
|
||
102 PTR pepa.kocourkov.hkfree.org.
|
||
129 PTR kocourkov.hkfree.org.
|
||
130 PTR pepa2.kocourkov.hkfree.org.
|
||
150 PTR karel.kocourkov.hkfree.org.
|
||
151 PTR karel.kocourkov.hkfree.org.
|
||
95 PTR pepa2.kocourkov.hkfree.org.
|
||
freenetis/trunk/kohana/application/helpers/text.php | ||
---|---|---|
return $str;
|
||
}
|
||
|
||
/**
|
||
* Czech & Slovak diacritical chars => ASCII by dgx
|
||
* -------------------------------------------------
|
||
*
|
||
* This source file is subject to the GNU GPL license.
|
||
*
|
||
* @author David Grudl <david@grudl.com>
|
||
* @link http://davidgrudl.com/
|
||
* @copyright Copyright (c) 2006 David Grudl
|
||
* @license GNU GENERAL PUBLIC LICENSE
|
||
* @category Text
|
||
* @version 1.0
|
||
*/
|
||
|
||
// WINDOWS-1250 to ASCII for diacritic chars
|
||
public static function cs_win2ascii($s)
|
||
{
|
||
return strtr($s, "\xe1\xe4\xe8\xef\xe9\xec\xed\xbe\xe5\xf2\xf3\xf6\xf5\xf4\xf8\xe0\x9a\x9d\xfa\xf9\xfc\xfb\xfd\x9e\xc1\xc4\xc8\xcf\xc9\xcc\xcd\xbc\xc5\xd2\xd3\xd6\xd5\xd4\xd8\xc0\x8a\x8d\xda\xd9\xdc\xdb\xdd\x8e", "aacdeeillnoooorrstuuuuyzAACDEEILLNOOOORRSTUUUUYZ");
|
||
|
||
}
|
||
|
||
// ISO-8859-2 to ASCII for diacritic chars
|
||
public static function cs_iso2ascii($s)
|
||
{
|
||
return strtr($s, "\xe1\xe4\xe8\xef\xe9\xec\xed\xb5\xe5\xf2\xf3\xf6\xf5\xf4\xf8\xe0\xb9\xbb\xfa\xf9\xfc\xfb\xfd\xbe\xc1\xc4\xc8\xcf\xc9\xcc\xcd\xa5\xc5\xd2\xd3\xd6\xd5\xd4\xd8\xc0\xa9\xab\xda\xd9\xdc\xdb\xdd\xae", "aacdeeillnoooorrstuuuuyzAACDEEILLNOOOORRSTUUUUYZ");
|
||
|
||
}
|
||
|
||
// UTF-8 to ASCII for diacritic chars
|
||
public static function cs_utf2ascii($s)
|
||
{
|
||
static $tbl = array("\xc3\xa1"=>"a","\xc3\xa4"=>"a","\xc4\x8d"=>"c","\xc4\x8f"=>"d","\xc3\xa9"=>"e","\xc4\x9b"=>"e","\xc3\xad"=>"i","\xc4\xbe"=>"l","\xc4\xba"=>"l","\xc5\x88"=>"n","\xc3\xb3"=>"o","\xc3\xb6"=>"o","\xc5\x91"=>"o","\xc3\xb4"=>"o","\xc5\x99"=>"r","\xc5\x95"=>"r","\xc5\xa1"=>"s","\xc5\xa5"=>"t","\xc3\xba"=>"u","\xc5\xaf"=>"u","\xc3\xbc"=>"u","\xc5\xb1"=>"u","\xc3\xbd"=>"y","\xc5\xbe"=>"z","\xc3\x81"=>"A","\xc3\x84"=>"A","\xc4\x8c"=>"C","\xc4\x8e"=>"D","\xc3\x89"=>"E","\xc4\x9a"=>"E","\xc3\x8d"=>"I","\xc4\xbd"=>"L","\xc4\xb9"=>"L","\xc5\x87"=>"N","\xc3\x93"=>"O","\xc3\x96"=>"O","\xc5\x90"=>"O","\xc3\x94"=>"O","\xc5\x98"=>"R","\xc5\x94"=>"R","\xc5\xa0"=>"S","\xc5\xa4"=>"T","\xc3\x9a"=>"U","\xc5\xae"=>"U","\xc3\x9c"=>"U","\xc5\xb0"=>"U","\xc3\x9d"=>"Y","\xc5\xbd"=>"Z");
|
||
return strtr($s, $tbl);
|
||
}
|
||
|
||
|
||
} // End text
|
freenetis/trunk/kohana/application/models/voip_sip.php | ||
---|---|---|
<?php
|
||
class Voip_sip_Model extends ORM {
|
||
|
||
//protected $belongs_to = array('user');
|
||
protected $belongs_to = array('user');
|
||
|
||
/**
|
||
* Function counts all records.
|
freenetis/trunk/kohana/application/controllers/members.php | ||
---|---|---|
{
|
||
$input->add_error('required', url_lang::lang('texts.Username already exists in database'));
|
||
}
|
||
else if (!ereg("^[a-z][a-z0-9]*$", $input->value))
|
||
else if (!ereg("^[a-z][a-z0-9]*[_]{0,1}[a-z0-9]+$", $input->value))
|
||
{
|
||
$input->add_error('required', url_lang::lang('texts.Login must contains only a-z and 0-9 and starts with literal.'));
|
||
}
|
freenetis/trunk/kohana/application/controllers/settings.php | ||
---|---|---|
|
||
// page title
|
||
$this->form->input('voip_number_interval')->label(url_lang::lang('texts.Number interval').':')->rules('length[19,19]|required')->value(addslashes($this->setting->voip_number_interval))->callback(array($this,'valid_voip_number_interval'));
|
||
$this->form->input('voip_sip_server')->label(url_lang::lang('texts.SIP Server').':')->rules('length[1,30]|required')->value(addslashes($this->setting->voip_sip_server));
|
||
$this->form->input('voip_number_exclude')->label(url_lang::lang('texts.Exclude numbers').':')->rules('length[9,100]')->value(addslashes($this->setting->voip_number_exclude))->callback(array($this,'valid_voip_number_exclude'));
|
||
$this->form->input('voip_sip_server')->label(url_lang::lang('texts.SIP Server').':')->rules('length[1,30]|required')->value(addslashes($this->setting->voip_sip_server));
|
||
$this->form->submit('submit')->value(url_lang::lang('texts.Save'));
|
||
special::required_forge_style($this->form, ' *', 'required');
|
||
|
||
... | ... | |
}
|
||
}
|
||
|
||
function valid_voip_number_exclude($input)
|
||
{
|
||
// parse interval to array of VoIP numbers
|
||
$numbers = explode(';',$input->value);
|
||
// check if count of numbers is smaller or longer than 2 (123456789, 987654321; NOT 123456,654321,987654)
|
||
|
||
foreach ($numbers as $number)
|
||
{
|
||
// check if first and second number are 9 characters long (123456789, NOT 1234567890)
|
||
if (strlen($number)!=9)
|
||
{
|
||
$input->add_error('required', url_lang::lang('texts.VoIP number must be 9 characters long'));
|
||
break;
|
||
}
|
||
// check if first and second number are numbers :-) (123456789, NOT abcdefghi)
|
||
if (!is_numeric($number))
|
||
{
|
||
$input->add_error('required', url_lang::lang('texts.VoIP number must be a number'));
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
// end of validatation function
|
||
}
|
||
?>
|
freenetis/trunk/kohana/application/controllers/redirection.php | ||
---|---|---|
*/
|
||
class Redirection_Controller extends Controller{
|
||
function index(){
|
||
exit;
|
||
url::redirect(url_lang::base().'redirection/show_all');
|
||
}
|
||
|
||
function addip(){
|
||
exit;
|
||
//duration type
|
||
$enum_type_model = new Enum_type_Model();
|
||
$types_duration = $enum_type_model->get_values(Enum_type_Model::$redirect_duration_id);
|
||
... | ... | |
}
|
||
|
||
function addrange(){
|
||
exit;
|
||
//duration type
|
||
$enum_type_model = new Enum_type_Model();
|
||
$types_duration = $enum_type_model->get_values(Enum_type_Model::$redirect_duration_id);
|
||
... | ... | |
}
|
||
|
||
function addsubnet($member_id=null){
|
||
exit;
|
||
//duration type
|
||
$enum_type_model = new Enum_type_Model();
|
||
$types_duration = $enum_type_model->get_values(Enum_type_Model::$redirect_duration_id);
|
||
... | ... | |
}
|
||
|
||
function adduser($member_id=null){
|
||
exit;
|
||
//duration type
|
||
$enum_type_model = new Enum_type_Model();
|
||
$types_duration = $enum_type_model->get_values(Enum_type_Model::$redirect_duration_id);
|
||
... | ... | |
}
|
||
|
||
function show_all($limit_results = 20, $order_by = 'id', $order_by_direction = 'ASC', $page_word = null, $page = 1){
|
||
exit;
|
||
//if (!$this->acl_check_view(get_class($this),'devices'))
|
||
// Controller::error(ACCESS);
|
||
|
||
... | ... | |
}
|
||
|
||
function show($redirection_id = NULL){
|
||
exit;
|
||
$redirection = new Redirection_Model($redirection_id);
|
||
if (!$redirection_id || !$redirection->id){
|
||
Controller::error(RECORD);
|
||
... | ... | |
|
||
function edit($redirection_id = null)
|
||
{
|
||
exit;
|
||
if (!isset($redirection_id))
|
||
Controller::warning(PARAMETER);
|
||
$redirection = new Redirection_Model($redirection_id);
|
||
... | ... | |
|
||
function delete($redirection_id = NULL)
|
||
{
|
||
exit;
|
||
if (!isset($redirection_id))
|
||
Controller::warning(PARAMETER);
|
||
|
||
... | ... | |
}
|
||
|
||
function delete_list($limit_results=20, $ip_address=0, $admin=0, $duration=0, $destination=0){
|
||
exit;
|
||
//if (!$this->acl_check_view(get_class($this),'devices'))
|
||
// Controller::error(ACCESS);
|
||
|
||
... | ... | |
|
||
function callback_valid_ip($input)
|
||
{
|
||
|
||
exit;
|
||
// $ip_subnet_mask = $_REQUEST["ip_subnet_mask"];
|
||
|
||
if (isset($_REQUEST["ip_address"])){
|
||
... | ... | |
|
||
function callback_valid_ip2($input)
|
||
{
|
||
exit;
|
||
$ip = $_REQUEST["ip_range2"];
|
||
|
||
if ($ip!=""){
|
||
... | ... | |
|
||
function callback_valid_mask($input)
|
||
{
|
||
exit;
|
||
$subnet_mask = $_REQUEST["ip_subnet_mask"];
|
||
|
||
if ($subnet_mask!=""){
|
||
... | ... | |
} // end of valid_ip
|
||
|
||
function administration($order_by = 'admin_id', $order_by_direction = 'ASC'){
|
||
exit;
|
||
//if (!$this->acl_check_view(get_class($this),'devices'))
|
||
// Controller::error(ACCESS);
|
||
|
||
... | ... | |
}
|
||
|
||
function autoadmins(){
|
||
exit;
|
||
//if (!$this->acl_check_view(get_class($this),'devices'))
|
||
// Controller::error(ACCESS);
|
||
|
||
... | ... | |
}
|
||
|
||
function addadmin(){
|
||
exit;
|
||
$this->form = new Forge(url_lang::base()."redirection/addadmin", '', 'POST', array('id' => 'article_form'));
|
||
$this->form->set_attr('class', 'form_class')->set_attr('method', 'post');
|
||
|
||
... | ... | |
|
||
function deleteadmin($admin_id = NULL)
|
||
{
|
||
exit;
|
||
if (!isset($admin_id))
|
||
Controller::warning(PARAMETER);
|
||
|
||
... | ... | |
}
|
||
|
||
function log($limit_results = 50, $order_by = 'id', $order_by_direction = 'DESC', $page_word = null, $page = 1){
|
||
exit;
|
||
//if (!$this->acl_check_view(get_class($this),'devices'))
|
||
// Controller::error(ACCESS);
|
||
|
freenetis/trunk/kohana/application/controllers/voip.php | ||
---|---|---|
Controller::warning(PARAMETER);
|
||
|
||
$voip_sip = new Voip_sip_Model();
|
||
|
||
//check existence of number
|
||
$voip = $voip_sip->get_record_by_user_limited($user_id);
|
||
// misto toho zkus toto
|
||
// $voip_sip = ORM::factory('voip_sip')->find_by_user($user_id);
|
||
// a pro prava
|
||
|
||
if ($voip->count() == 0)
|
||
Controller::error(4);
|
||
|
||
$voip = $voip_sip->get_record_by_user($user_id);;
|
||
|
||
// if (!this->acl_check_view('VoIP_Controller', 'voip', $voip_sip->user->member_id)) Controller:error(ACCESS);
|
||
|
||
if ($voip->count() == 0)
|
||
... | ... | |
else
|
||
$link_status = false;
|
||
|
||
$view = new View('main');
|
||
$view->title = url_lang::lang('texts.Show VoIP');
|
||
$view->content = new View('voip/show');
|
||
$view->content->headline = url_lang::lang('texts.Show VoIP');
|
||
$view->content->voip = $voip;
|
||
$view = new View('main');
|
||
$view->title = url_lang::lang('texts.Show VoIP');
|
||
$view->content = new View('voip/show');
|
||
$view->content->headline = url_lang::lang('texts.Show VoIP');
|
||
$view->content->voip = $voip;
|
||
$view->content->sip_server = $sip_server;
|
||
$view->content->link_status = $link_status;
|
||
$view->content->ipaddr = $voip->ipaddr;
|
||
$view->content->port = $voip->port;
|
||
$view->content->regseconds = ($voip->regseconds - time()< 0 )?'0':$voip->regseconds - time();
|
||
$view->content->voicemail = $voicemail;
|
||
$view->render(TRUE);
|
||
$view->render(true);
|
||
|
||
}
|
||
|
||
... | ... | |
$voicemail_model = new Voip_voicemail_user_Model();
|
||
$voicemail = $voicemail_model->find_by_customer_id($voip->mailbox);
|
||
|
||
$form = new Forge(url_lang::base()."voip/edit_voicemail/".$user_id, '', 'POST', array('id' => 'article_form'));
|
||
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
|
||
$form = new Forge(url_lang::base()."voip/edit_voicemail/".$user_id, '', 'POST', array('id' => 'article_form'));
|
||
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
|
||
$form->password('password')->label(url_lang::lang('texts.New password').':')->rules('required|length[4,4]')->callback(array($this,'valid_voip_voicemail_password'));
|
||
$form->password('confirm_password')->label(url_lang::lang('texts.Confirm new password').':')->rules('required|length[4,4]')->matches($form->password);
|
||
$form->input('email')->label(url_lang::lang('texts.email').':')->rules('length[6,50]|required')->value($voicemail->email)->callback(array($this,'valid_voip_voicemail_email'));
|
||
$form->password('confirm_password')->label(url_lang::lang('texts.Confirm new password').':')->rules('required|length[4,4]')->matches($form->password);
|
||
$form->input('email')->label(url_lang::lang('texts.email').':')->rules('length[6,50]|required')->value($voicemail->email)->callback(array($this,'valid_voip_voicemail_email'));
|
||
|
||
$form->submit('submit')->value(url_lang::lang('texts.Change'));
|
||
|
||
... | ... | |
if (!isset($user_id))
|
||
Controller::warning(1);
|
||
|
||
//kontrola existence cisla voip
|
||
$user = ORM::factory('user')->find_by_id($user_id);
|
||
|
||
if ($user->id == 0)
|
||
Controller::error(4);
|
||
|
||
$voip_sip = new Voip_sip_Model();
|
||
$voip = $voip_sip->get_record_by_user_limited($user_id);
|
||
|
||
... | ... | |
if (!isset($user_id))
|
||
Controller::warning(1);
|
||
|
||
$voip_sip = new Voip_sip_Model();
|
||
//kontrola existence usera
|
||
$user = ORM::factory('user')->find_by_id($user_id);
|
||
|
||
if ($user->id == 0)
|
||
Controller::error(4);
|
||
|
||
if ($this->input->post('ranges') != NULL)
|
||
{
|
||
$number = $this->input->post('ranges');
|
||
|
||
$user = ORM::factory('user')->where('id', $user_id)->find();
|
||
|
||
$username = text::cs_utf2ascii($user->name.' '.$user->surname);
|
||
|
||
$voip_new = new Voip_sip_Model();
|
||
$voip_new->name = $number;
|
||
$voip_new->user_id = $user_id;
|
||
$voip_new->callerid = $username.' <'.$number.'>';
|
||
$voip_new->mailbox = $number;
|
||
$voip_new->secret = security::generate_password();
|
||
$voip_new->username = $number;
|
||
$voip_new->save();
|
||
|
||
$voicemail = new Voip_voicemail_user_Model();
|
||
$voicemail->customer_id = $number;
|
||
$voicemail->mailbox = $number;
|
||
$voicemail->password = security::generate_numeric_password(4);
|
||
$voicemail->fullname = $username;
|
||
$voicemail->email =$user->email;
|
||
$voicemail->save();
|
||
}
|
||
|
||
$voip_sip = new Voip_sip_Model();
|
||
|
||
//check existence of number
|
||
$voip = $voip_sip->get_record_by_user_limited($user_id);
|
||
|
||
if ($voip->count() != 0)
|
||
... | ... | |
if ($config_model->check_exist_variable('voip_number_interval'))
|
||
{
|
||
$ranges = array();
|
||
$used_numbers = array();
|
||
$ranges = explode('-', $config_model->get_value_from_name('voip_number_interval'));
|
||
|
||
$exclude_numbers = explode(';', $config_model->get_value_from_name('voip_number_exclude'));
|
||
|
||
$exist_numbers = $voip_sip->select('name')->find_all();
|
||
|
||
for($i = 0; $i < $exist_numbers->count(); $i++)
|
||
{
|
||
$exclude[$i] = $exist_numbers->current()->name;
|
||
$exist_numbers->next();
|
||
}
|
||
$i = 0;
|
||
foreach($exist_numbers as $exist_number)
|
||
{
|
||
$used_numbers[$i] = $exist_number->name;
|
||
$i++;
|
||
}
|
||
|
||
|
||
for($i = $ranges[0]; $i <= $ranges[1]; $i++)
|
||
{
|
||
if (!in_array($i,$exclude))
|
||
if (!in_array($i,$used_numbers) && !in_array($i,$exclude_numbers))
|
||
$selection[$i] = $i;
|
||
}
|
||
|
||
|
||
|
||
}
|
||
else
|
||
{
|
||
... | ... | |
$ranges = form::dropdown('ranges',$selection,'standard');
|
||
|
||
$view = new View('main');
|
||
$view->title = url_lang::lang('texts.Add VoIP account');
|
||
$view->content = new View('voip/add');
|
||
$view->title = url_lang::lang('texts.Add VoIP account');
|
||
$view->content = new View('voip/add');
|
||
$view->content->user_id = $user_id;
|
||
$view->content->ranges = $ranges;
|
||
$view->render(TRUE);
|
||
$view->render(TRUE);
|
||
|
||
//echo Str_Replace(
|
||
|
||
// Array("á","č","ď","é","ě","í","ľ","ň","ó","ř","š","ť","ú","ů","ý ","ž","Á","Č","Ď","É","Ě","Í","Ľ","Ň","Ó","Ř","Š","Ť","Ú","Ů","Ý","Ž") ,
|
||
|
||
// Array("a","c","d","e","e","i","l","n","o","r","s","t","u","u","y ","z","A","C","D","E","E","I","L","N","O","R","S","T","U","U","Y","Z") ,
|
||
|
||
/// $voip->regseconds 'ěščřžýáíé');
|
||
|
||
//$text = "příliš žluťoučký kůň úpěl ďábelské ódy"
|
||
//echo(StrTr($text, "ÁÄČÇĎÉĚËÍŇÓÖŘŠŤÚŮÜÝŽáäčçďéěëíňóöřšťúůüýž", "AACCDEEEINOORSTUUUYZaaccdeeeinoorstuuuyz"));
|
||
}
|
||
|
||
function valid_voip_voicemail_password($input)
|
freenetis/trunk/kohana/application/controllers/backup.php | ||
---|---|---|
*/
|
||
class Backup_Controller extends Controller{
|
||
function index(){
|
||
exit;
|
||
url::redirect(url_lang::base().'backup/show_all');
|
||
}
|
||
|
||
function show_all($limit_results = 20, $order_by = 'id', $order_by_direction = 'ASC', $page_word = null, $page = 1){
|
||
exit;
|
||
//if (!$this->acl_check_view(get_class($this),'devices'))
|
||
// Controller::error(ACCESS);
|
||
|
freenetis/trunk/kohana/application/controllers/registration.php | ||
---|---|---|
{
|
||
$input->add_error('required', url_lang::lang('texts.Username already exists in database'));
|
||
}
|
||
else if (!ereg("^[a-z][a-z0-9]*$", $input->value))
|
||
else if (!ereg("^[a-z][a-z0-9]*[_]{0,1}[a-z0-9]+$", $input->value))
|
||
{
|
||
$input->add_error('required', url_lang::lang('texts.Login must contains only a-z and 0-9 and starts with literal.'));
|
||
}
|
freenetis/trunk/kohana/application/controllers/config_files.php | ||
---|---|---|
|
||
function __construct()
|
||
{
|
||
exit;
|
||
parent::__construct();
|
||
$array[] = html::anchor(url_lang::base().'config_files/dhcp', url_lang::lang('texts.DHCP'));
|
||
$array[] = html::anchor(url_lang::base().'config_files/dns_reverse', url_lang::lang('texts.Reverse DNS'));
|
||
... | ... | |
}
|
||
|
||
function index(){
|
||
exit;
|
||
url::redirect(url_lang::base().'config_files/dhcp');
|
||
}
|
||
|
||
function dhcp(){
|
||
exit;
|
||
$this->form = new Forge(url_lang::base()."config_files/dhcp", '', 'POST', array('id' => 'article_form'));
|
||
$this->form->set_attr('class', 'form_class')->set_attr('method', 'post');
|
||
|
||
... | ... | |
}
|
||
|
||
function dns_reverse(){
|
||
exit;
|
||
$area_model = new Area_Model();
|
||
$areas = $area_model->get_area_prefixes();
|
||
$arr_area_prefixes[] = '----- '.url_lang::lang('texts.select area prefix').' -----';
|
||
... | ... | |
}
|
||
|
||
function dns_forward(){
|
||
exit;
|
||
$area_model = new Area_Model();
|
||
$areas = $area_model->get_areas();
|
||
$arr_areas[] = '----- '.url_lang::lang('texts.select area').' -----';
|
||
... | ... | |
}
|
||
|
||
function mac_restriction(){
|
||
exit;
|
||
$this->form = new Forge(url_lang::base()."config_files/mac_restriction", '', 'POST', array('id' => 'article_form'));
|
||
$this->form->set_attr('class', 'form_class')->set_attr('method', 'post');
|
||
|
||
... | ... | |
}
|
||
|
||
function settings(){
|
||
exit;
|
||
// access control
|
||
//if (!$this->acl_check_edit('Settings_Controller','system'))
|
||
// Controller::error(ACCESS);
|
||
... | ... | |
}
|
||
|
||
function generate_dhcp($primary_dns, $secondary_dns, $tertiary_dns, $lease_time, $max_lease_time, $subnet_id, $routers_ip_address, $subnet_id2, $routers_ip_address2, $subnet_id3, $routers_ip_address3){
|
||
exit;
|
||
$settings = new Config_file_Model(1);
|
||
$subnet = new Subnet_Model($subnet_id);
|
||
|
||
... | ... | |
}
|
||
|
||
function time_conversion($time){
|
||
exit;
|
||
$hours = round($time/3600);
|
||
$days = round($hours/24);
|
||
$weeks = round($days/7);
|
||
... | ... | |
}
|
||
|
||
function generate_dns_reverse($area_prefix = 0, $refresh = 28800, $retry = 7200, $expire = 604800, $minimum = 86400, $time_to_live = 86400, $name_server = null, $name_server2 = null, $mail_exchange = null, $soa_record = null, $dns_admin = null){
|
||
exit;
|
||
$settings = new Config_file_Model(1);
|
||
$area_model = new Area_Model();
|
||
$result = $area_model->get_records_by_prefix($area_prefix);
|
||
... | ... | |
|
||
|
||
function generate_dns_forward($area = 0, $refresh = 28800, $retry = 7200, $expire = 604800, $minimum = 86400, $time_to_live = 86400, $name_server = null, $name_server2 = null, $mail_exchange = null, $soa_record = null, $dns_admin = null){
|
||
exit;
|
||
$settings = new Config_file_Model(1);
|
||
$area_model = new Area_Model();
|
||
$result = $area_model->get_records_by_area($area);
|
||
... | ... | |
}
|
||
|
||
function generate_mac_restriction($subnet_id = 0, $routers_ip_address = null){
|
||
exit;
|
||
$settings = new Config_file_Model(1);
|
||
$subnet = new Subnet_Model($subnet_id);
|
||
|
||
... | ... | |
}
|
||
|
||
function callback_valid_ip($input)
|
||
{
|
||
{
|
||
exit;
|
||
if (isset($_REQUEST["primary_dns"])){
|
||
$ip = $_REQUEST["primary_dns"];
|
||
} else if (isset($_REQUEST["secondary_dns"])){
|
||
... | ... | |
* @return unknown_type
|
||
*/
|
||
function valid_ip($input){
|
||
exit;
|
||
$ip = ip2long($this->input->post('routers_ip_address')); // Submitted values
|
||
$subnet_id = $this->input->post('subnet_id');
|
||
|
||
... | ... | |
* @return unknown_type
|
||
*/
|
||
function valid_ip2($input){
|
||
exit;
|
||
$ip = ip2long($this->input->post('routers_ip_address2')); // Submitted values
|
||
$subnet_id = $this->input->post('subnet_id2');
|
||
|
||
... | ... | |
* @return unknown_type
|
||
*/
|
||
function valid_ip3($input){
|
||
exit;
|
||
$ip = ip2long($this->input->post('routers_ip_address3')); // Submitted values
|
||
$subnet_id = $this->input->post('subnet_id3');
|
||
|
||
... | ... | |
*/
|
||
function check_ip($ip, $net, $mask, $input)
|
||
{
|
||
exit;
|
||
$mask=0xffffffff<<(32-$mask) & 0xffffffff;
|
||
//printf(" ip=%lx, net=%lx, mask=%lx, AND=%lx", $ip, $net, $mask, $ip & $mask);
|
||
if (($ip & $mask) != $net)
|
freenetis/trunk/kohana/application/views/menu.php | ||
---|---|---|
</ul>
|
||
</li>
|
||
|
||
<?php //zakomentovano dokud nebudou navrzena prava ....Boner ?>
|
||
<?php if (false){ ?>
|
||
|
||
<?/**
|
||
* @author Lubomir Buben
|
||
* Menu for Redirection module
|
||
... | ... | |
<li><?php echo html::anchor(url_lang::base().'backup/make_backup', url_lang::lang('texts.Make backup')) ?></li>
|
||
</ul>
|
||
</li><?php //} ?>
|
||
<?php } ?>
|
||
|
||
|
||
<?php if ($this->acl_check_2D('menu', 'accounts') || $this->acl_check_2D('menu', 'unidentified_transfers')) { ?>
|
||
<li class="transfer"><h2><?php echo url_lang::lang('texts.Finances') ?></h2>
|
||
<ul>
|
freenetis/trunk/kohana/application/views/voip/add.php | ||
---|---|---|
<?php echo url_lang::lang('texts.Warning').': '.url_lang::lang('texts.If you choose your VoIP number there is no chance how to take it back. Please vote your number carefully.'); ?><br />
|
||
<br />
|
||
<br />
|
||
<?php echo form::open(url_lang::base().'/voip/add/', array('method'=>'post')); ?>
|
||
<?php echo form::open(url_lang::base().'/voip/add/'.$user_id, array('method'=>'post')); ?>
|
||
<table>
|
||
<tr>
|
||
<td><?php echo url_lang::lang('texts.Number ranges'.':'); ?></td>
|
Také k dispozici: Unified diff
Přidána metoda add pro kontroler Voip. Opravenz menší chzbkz v kontroleru registration a members. Zakomentované kontrolery backups, redirection a config_files z důvodu špatných práv.