Revize 704
Přidáno uživatelem Jiří Sviták před asi 14 roky(ů)
freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'absolute majority' => 'Absolutní většina',
|
||
'abstain' => 'Zdržet se',
|
||
'about sms' => 'Informace o SMS',
|
||
'access control list items' => 'Položky seznamu pro řízení přístupu',
|
||
'access rights' => 'Přístupová práva',
|
||
'access to system' => 'Přístup do systému',
|
||
'according to freenetis' => 'podle freenetisu',
|
||
... | ... | |
'account transfers' => 'Převody účtu',
|
||
'account type' => 'Typ účtu',
|
||
'accounting system' => 'Účetní osnova',
|
||
'accounts' => 'Účty',
|
||
'action' => 'Akce',
|
||
'activate' => 'Aktivovat',
|
||
'activated number has not been changed' => 'Aktivované číslo již nelze změnit',
|
||
... | ... | |
'address book' => 'Telefonní adresář',
|
||
'address of connecting place' => 'Adresa přípojného místa',
|
||
'address map' => 'Adresní mapa',
|
||
'address point' => 'Adresní bod',
|
||
'address point detail' => 'Detail adresního bodu',
|
||
'address point has been successfully deleted' => 'Adresní bod byl úspěšně smazán.',
|
||
'address point has been successfully updated' => 'Adresní bod byl úspěšně aktualizován.',
|
||
... | ... | |
'all ip addresses of member' => 'všem IP adresám člena',
|
||
'all redirected' => 'Všichni přesměrovaní',
|
||
'all transfers' => 'Všechny převody',
|
||
'allow' => 'Povolit',
|
||
'amount' => 'Částka',
|
||
'and now, click login' => 'A nyní klikněte na "Přihlásit".',
|
||
'antenna' => 'Anténa',
|
||
... | ... | |
'counteraccount number' => 'Číslo protiúčtu',
|
||
'create backup' => 'Vytvořit zálohu',
|
||
'create date' => 'Datum vytvoření',
|
||
'creating of all records' => 'Vytváření všech záznamů',
|
||
'creating of own records' => 'Vytváření vlastních záznamů',
|
||
'credit' => 'Kredit',
|
||
'credit subaccounts' => 'Kreditní podúčty',
|
||
'csv file template' => 'Šablona CSV souboru',
|
||
... | ... | |
'delete whole device' => 'Smazat celé zařízení',
|
||
'delete wireless setting' => 'Smazat bezdrátové nastavení',
|
||
'deleted' => 'Smazáno',
|
||
'deleting of all records' => 'Mazání všech záznamů',
|
||
'deleting of own records' => 'Mazání vlastních záznamů',
|
||
'deny' => 'Odepřít',
|
||
'dependent transfer' => 'Závislý převod',
|
||
'deposit' => 'Vklad',
|
||
'description' => 'Popis',
|
||
... | ... | |
'edited' => 'Upravil',
|
||
'editing of account' => 'Úprava účtu',
|
||
'editing of address point' => 'Úprava adresního bodu',
|
||
'editing of all records' => 'Úprava všech záznamů',
|
||
'editing of bank statement' => 'Úprava bankovního výpisu',
|
||
'editing of member' => 'Úprava člena',
|
||
'editing of own records' => 'Úprava vlastních záznamů',
|
||
'editing of street' => 'Úprava ulice',
|
||
'editing of town' => 'Úprava města',
|
||
'editing of transfer' => 'Úprava převodu',
|
||
... | ... | |
'generation of configuration files' => 'Generování konfiguračních souborů',
|
||
'gps' => 'GPS souřadnice',
|
||
'group' => 'Skupina',
|
||
'groups of users' => 'Skupiny uživatelů',
|
||
'growth of members' => 'Růst členů',
|
||
'help' => 'Nápověda',
|
||
'help register' => 'Registr nápovědy',
|
||
... | ... | |
'variable symbol has not been found in the database' => 'Variabilní symbol nebyl nalezen v databázi.',
|
||
'vat' => 'DPH',
|
||
'version' => 'verze',
|
||
'viewing of all records' => 'Prohlížení všech záznamů',
|
||
'viewing of own records' => 'Prohlížení vlastních záznamů',
|
||
'virus' => 'Počítačový vir',
|
||
'vlan detail' => 'Detail VLANu',
|
||
'vlan interface' => 'VLAN rozhraní',
|
freenetis/trunk/kohana/application/models/acl.php | ||
---|---|---|
<?php
|
||
class Acl_Model extends Model
|
||
{
|
||
function get_acl()
|
||
{
|
||
return $this->db->query("
|
||
SELECT acl.id AS acl_id, acl.note, acl.allow
|
||
FROM acl
|
||
");
|
||
}
|
||
}
|
||
?>
|
freenetis/trunk/kohana/application/models/aco.php | ||
---|---|---|
<?php
|
||
class Aco_Model extends Model
|
||
{
|
||
function get_aco_by_acl($acl_id)
|
||
{
|
||
return $this->db->query("
|
||
SELECT aco.name
|
||
FROM aco
|
||
JOIN aco_map am ON am.value = aco.value AND am.section_value = aco.section_value
|
||
WHERE am.acl_id = $acl_id
|
||
");
|
||
}
|
||
}
|
||
?>
|
freenetis/trunk/kohana/application/models/axo.php | ||
---|---|---|
<?php
|
||
class Axo_Model extends Model
|
||
{
|
||
function get_axo_by_acl($acl_id)
|
||
{
|
||
return $this->db->query("
|
||
SELECT axo.id, axo.section_value, axo.name
|
||
FROM axo
|
||
JOIN axo_map am ON am.value = axo.value AND am.section_value = axo.section_value
|
||
WHERE am.acl_id = $acl_id
|
||
");
|
||
}
|
||
}
|
||
?>
|
freenetis/trunk/kohana/application/controllers/members.php | ||
---|---|---|
$enum_type_model = new Enum_type_Model();
|
||
$former_member = $member_data->member_type == 'Former member';
|
||
|
||
// get balance of member's credit account, association doesn't have credit account
|
||
// credit account
|
||
if ($member_id != 1)
|
||
{
|
||
$model_accounts = new Account_Model();
|
||
$account = $model_accounts->
|
||
$account_model = new Account_Model();
|
||
$account = $account_model->
|
||
where(array('member_id' => $member_id,
|
||
'account_attribute_id' => Account_attribute_Model::$credit))->find();
|
||
// count expiration date of credit
|
||
$balance = $account->get_account_balance($account->id);
|
||
if ($balance == 0)
|
||
{
|
||
$expiration_date = null;
|
||
}
|
||
else
|
||
{
|
||
$fee_model = new Fee_Model();
|
||
$fee = $fee_model->get_by_date_type(date('Y-m-d'), 'regular member fee');
|
||
if ($fee->fee > 0)
|
||
{
|
||
$expiration_date = date('Y-m-d', mktime(0, 0, 0, date('m'), 1, date('Y')) + (($balance / $fee->fee) * 30 * 24 * 60 * 60));
|
||
}
|
||
else
|
||
{
|
||
$expiration_date = url_lang::lang('texts.No member fee set!');
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// contacts of main user of member
|
||
$model_contacts = new Contact_Model();
|
||
$contacts = $model_contacts->find_all_by_user_id($member_data->id);
|
||
... | ... | |
$view->content->town = $town;
|
||
$view->content->zip = $zip;
|
||
if ($member_id != 1)
|
||
$view->content->expiration_date = $expiration_date;
|
||
$view->content->expiration_date = self::get_expiration_date($account);
|
||
$view->content->contact_types = $arr_contact_types;
|
||
$view->content->contacts = $contacts;
|
||
$view->content->engineer_id = $engineer_id;
|
||
... | ... | |
}
|
||
|
||
/**
|
||
* Gets expiration date of member's payments.
|
||
* @author Jiri Svitak
|
||
* @param $member_id
|
||
* @return unknown_type
|
||
*/
|
||
public static function get_expiration_date($account)
|
||
{
|
||
$balance = $account->get_account_balance($account->id);
|
||
// zero credit account balance means that there is no need to calculate expiration date
|
||
if ($balance == 0)
|
||
return null;
|
||
// negative credit account balance means that member is in debt
|
||
if ($balance < 0)
|
||
return '<span style="color:red">'.url_lang::lang('texts.You are in debt').'</span>';
|
||
$fee_model = new Fee_Model();
|
||
$pdate = date_parse(date('Y-m-d'));
|
||
$year = $pdate['year'];
|
||
if ($pdate['day'] > 15)
|
||
{
|
||
$month = $pdate['month'] + 1;
|
||
if ($month == 13)
|
||
{
|
||
$month = 1;
|
||
$year++;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
$month = $pdate['month'];
|
||
}
|
||
$credit_left = $balance;
|
||
while (true)
|
||
{
|
||
$date = date('Y-m-d', mktime(0, 0, 0, $month, 1, $year));
|
||
$fee = $fee_model->get_by_date_type($date, 'regular member fee');
|
||
// fee has to be defined for every month of membership of every member
|
||
if ($fee->fee <= 0)
|
||
{
|
||
return url_lang::lang('texts.No member fee set!');
|
||
}
|
||
else
|
||
{
|
||
if ($credit_left < $fee->fee)
|
||
break;
|
||
$credit_left -= $fee->fee;
|
||
}
|
||
// next month
|
||
$month++;
|
||
if ($month == 13)
|
||
{
|
||
$month = 1;
|
||
$year++;
|
||
}
|
||
}
|
||
$expiration_date = date('Y-m-d', mktime(0, 0, 0, $month, 1, $year) + ($credit_left / $fee->fee) * 30 * 24 * 60 * 60);
|
||
return $expiration_date;
|
||
}
|
||
|
||
function koko(){}
|
||
|
||
/**
|
||
* Function adds new member to database. Creates user of type member assigned to this member.
|
||
* @return unknown_type
|
||
*/
|
freenetis/trunk/kohana/application/controllers/voip_calls.php | ||
---|---|---|
|
||
function show_by_member($member_id = null, $from = null, $to = null, $limit_results = 100, $order_by = 'type', $order_by_direction = 'asc', $page_word = null, $page = 1)
|
||
{
|
||
if (!$this->acl_check_view('VoIP_Controller', 'voip'))
|
||
if (!$this->acl_check_view('VoIP_Controller', 'voip', $member_id))
|
||
Controller::error(ACCESS);
|
||
// get new selector
|
||
if (!is_numeric($member_id))
|
||
... | ... | |
|
||
function show_by_user($user_id = null, $from = null, $to = null, $limit_results = 100, $order_by = 'type', $order_by_direction = 'asc', $page_word = null, $page = 1)
|
||
{
|
||
if (!$this->acl_check_view('VoIP_Controller', 'voip'))
|
||
Controller::error(ACCESS);
|
||
// get new selector
|
||
if (!is_numeric($user_id))
|
||
Controller::error(RECORD);
|
||
|
||
$user = ORM::factory('user')->find_by_id($user_id);
|
||
|
||
$user = new User_Model($user_id);
|
||
if ($user->id == null)
|
||
Controller::error(RECORD);
|
||
if (!$this->acl_check_view('VoIP_Controller', 'voip', $user->member_id))
|
||
Controller::error(ACCESS);
|
||
|
||
|
||
|
||
|
||
|
||
$billing = new Billing();
|
||
|
||
if (!$billing->has_driver() || ($billing->get_account($user->member_id) == null))
|
freenetis/trunk/kohana/application/controllers/transfers.php | ||
---|---|---|
$outbound = $transfers->current()->outbound;
|
||
$balance = $inbound - $outbound;
|
||
}
|
||
// count expiration date from current balance
|
||
if ($balance == 0)
|
||
{
|
||
$expiration_date = null;
|
||
}
|
||
else
|
||
{
|
||
$fee_model = new Fee_Model();
|
||
$fee = $fee_model->get_by_date_type(date('Y-m-d'), 'regular member fee');
|
||
if ($fee->fee > 0)
|
||
{
|
||
$expiration_date = date('Y-m-d', mktime(0, 0, 0, date('m'), 1, date('Y')) + (($balance / $fee->fee) * 30 * 24 * 60 * 60));
|
||
}
|
||
else
|
||
{
|
||
$expiration_date = url_lang::lang('texts.No member fee set!');
|
||
}
|
||
}
|
||
// headline
|
||
$headline = url_lang::lang('texts.Transfers of double-entry account');
|
||
// grid of transfers
|
||
... | ... | |
$view->content->balance = $balance;
|
||
$view->content->inbound = $inbound;
|
||
$view->content->outbound = $outbound;
|
||
$view->content->expiration_date = $expiration_date;
|
||
$view->content->expiration_date = Members_Controller::get_expiration_date($account);
|
||
$view->content->grid = $grid;
|
||
$view->content->message = $this->session->get_once('message');
|
||
$view->render(TRUE);
|
freenetis/trunk/kohana/application/controllers/voip.php | ||
---|---|---|
|
||
function show($user_id = NULL)
|
||
{
|
||
$user = new User_Model($user_id);
|
||
if (!$this->acl_check_view('VoIP_Controller', 'voip', $user->member_id))
|
||
Controller::error(ACCESS);
|
||
|
||
$voip_sip = new Voip_sip_Model();
|
||
|
||
//check existence of number
|
||
... | ... | |
else
|
||
$link_status = false;
|
||
|
||
$user = ORM::factory('user')->find_by_id($user_id);
|
||
|
||
$billing = new Billing();
|
||
|
||
... | ... | |
function change_password($user_id = NULL)
|
||
{
|
||
if (!isset($user_id))
|
||
Controller::warning(1);
|
||
|
||
Controller::warning(PARAMETER);
|
||
$user = new User_Model($user_id);
|
||
if (!$this->acl_check_edit('VoIP_Controller', 'voip_password', $user->member_id))
|
||
Controller::error(ACCESS);
|
||
|
||
$voip = ORM::factory('voip_sip')->find_by_user_id($user_id);
|
||
|
||
if ($voip->id == null)
|
||
... | ... | |
function edit_account($user_id = NULL)
|
||
{
|
||
if (!isset($user_id))
|
||
Controller::warning(1);
|
||
Controller::warning(PARAMETER);
|
||
$user = new User_Model($user_id);
|
||
if (!$this->acl_check_edit('VoIP_Controller', 'voip_password', $user->member_id))
|
||
Controller::error(ACCESS);
|
||
|
||
$voip = ORM::factory('voip_sip')->find_by_user_id($user_id);
|
||
|
||
... | ... | |
$voip_sip = new Voip_sip_Model();
|
||
$voip = $voip_sip->find_by_user_id($user_id);
|
||
|
||
$user = ORM::factory('user')->where('id', $user_id)->find();
|
||
|
||
$username = text::cs_utf2ascii($user->name.' '.$user->surname);
|
||
|
||
$voip->callerid = $username.' <'.$voip->name.'>';
|
||
... | ... | |
function change_voicemail_password($user_id = NULL)
|
||
{
|
||
if (!isset($user_id))
|
||
Controller::warning(1);
|
||
|
||
Controller::warning(PARAMETER);
|
||
$user = new User_Model($user_id);
|
||
if (!$this->acl_check_edit('VoIP_Controller', 'voip_password', $user->member_id))
|
||
Controller::error(ACCESS);
|
||
|
||
$voip = ORM::factory('voip_sip')->find_by_user_id($user_id);
|
||
|
||
if ($voip->id == null)
|
||
... | ... | |
function edit_voicemail($user_id = NULL)
|
||
{
|
||
if (!isset($user_id))
|
||
Controller::warning(1);
|
||
|
||
Controller::warning(PARAMETER);
|
||
$user = new User_Model($user_id);
|
||
if (!$this->acl_check_edit('VoIP_Controller', 'voip_password', $user->member_id))
|
||
Controller::error(ACCESS);
|
||
|
||
$voip = ORM::factory('voip_sip')->find_by_user_id($user_id);
|
||
|
||
if ($voip->id == null)
|
||
... | ... | |
|
||
if (!is_numeric($member_id))
|
||
Controller::error(RECORD);
|
||
|
||
|
||
if (!$this->acl_check_edit('VoIP_Controller', 'voip_password', $member_id))
|
||
Controller::error(ACCESS);
|
||
|
||
|
||
$member = ORM::factory('member')->find($member_id);
|
||
|
||
if ($member->id == null)
|
||
... | ... | |
function edit($user_id = NULL)
|
||
{
|
||
if (!isset($user_id))
|
||
Controller::warning(1);
|
||
|
||
//kontrola existence cisla voip
|
||
$user = ORM::factory('user')->find_by_id($user_id);
|
||
|
||
Controller::warning(PARAMETER);
|
||
$user = new User_Model($user_id);
|
||
if ($user->id == null)
|
||
Controller::error(4);
|
||
Controller::error(RECORD);
|
||
|
||
if (!$this->acl_check_edit('VoIP_Controller', 'voip', $user->member_id))
|
||
Controller::error(ACCESS);
|
||
|
||
$voip_sip = new Voip_sip_Model();
|
||
$voip = $voip_sip->get_record_by_user_limited($user_id);
|
||
|
||
if ($voip->count() == 0)
|
||
Controller::error(4);
|
||
Controller::error(RECORD);
|
||
|
||
|
||
}
|
||
... | ... | |
function add($user_id = NULL)
|
||
{
|
||
if (!isset($user_id))
|
||
Controller::warning(1);
|
||
Controller::warning(PARAMETER);
|
||
|
||
//kontrola existence usera
|
||
$user = ORM::factory('user')->find_by_id($user_id);
|
||
|
||
$user = new User_Model($user_id);
|
||
if ($user->id == null)
|
||
Controller::error(4);
|
||
Controller::error(RECORD);
|
||
if (!$this->acl_check_new('VoIP_Controller', 'voip', $user->member_id))
|
||
Controller::error(ACCESS);
|
||
|
||
if ($this->input->post('ranges') != NULL)
|
||
{
|
freenetis/trunk/kohana/application/controllers/access_rights.php | ||
---|---|---|
<?php
|
||
class Access_Rights_Controller extends Controller {
|
||
class Access_rights_Controller extends Controller
|
||
{
|
||
|
||
function index()
|
||
{
|
||
url::redirect(url_lang::base().'access_rights/show_groups');
|
||
}
|
||
|
||
function index()
|
||
{
|
||
url::redirect(url_lang::base().'access_rights/show_groups');
|
||
}
|
||
function show_groups()
|
||
{
|
||
|
||
function show_groups()
|
||
{
|
||
if(!$this->acl_check_view('Settings_Controller', 'access_rights'))
|
||
Controller::Error(ACCESS);
|
||
|
||
if(!$this->acl_check_view('Settings_Controller', 'access_rights')) Controller::Error(1);
|
||
$rows;
|
||
|
||
$aro_group_model = new Aro_group_Model();
|
||
$groups = $aro_group_model->get_traverz_tree();
|
||
|
||
$rows;
|
||
|
||
$aro_group_model = new Aro_group_Model();
|
||
$groups = $aro_group_model->get_traverz_tree();
|
||
$model_groups_aro_map = new Groups_Aro_Map_Model();
|
||
|
||
$model_groups_aro_map = new Groups_Aro_Map_Model();
|
||
|
||
//vykresleni skupin
|
||
for($i = 0; $i < $groups->count(); $i++)
|
||
//vykresleni skupin
|
||
for($i = 0; $i < $groups->count(); $i++)
|
||
{
|
||
$group = $groups->current();
|
||
$ret = ''; //style="text-align: center; font-weight:bold" style="width: 300px; text-align: center; font-weight:bold"
|
||
$rows[0] = '<tr><th colspan="3" style="width:300px">'.url_lang::lang('texts.Edit groups').'</th></tr>';
|
||
//vypocet posunuti podskupiny
|
||
for($j = 0; $j < count_parent($group->id) - 1; $j++ )
|
||
//$ret .= ' |';
|
||
$ret .= ' ';
|
||
$group = $groups->current();
|
||
$ret = ''; //style="text-align: center; font-weight:bold" style="width: 300px; text-align: center; font-weight:bold"
|
||
$rows[0] = '<tr><th colspan="3" style="width:300px">'.url_lang::lang('texts.Edit groups').'</th></tr>';
|
||
//vypocet posunuti podskupiny
|
||
for($j = 0; $j < $this->count_parent($group->id) - 1; $j++ )
|
||
//$ret .= ' |';
|
||
$ret .= ' ';
|
||
|
||
//$ret = $ret . '--- ';
|
||
//$ret = $ret . '--- ';
|
||
|
||
$count = $model_groups_aro_map->count_rows_by_group_id($group->id);
|
||
$count = $model_groups_aro_map->count_rows_by_group_id($group->id);
|
||
|
||
if ($group->id == 21)
|
||
$rows[$i + 1] = '<tr><td style="width:400px">'.$ret.url_lang::lang('texts.'.$group->name).'</td><td style="width:30px; text-align: center" >'.$count.'</td><td>'.url_lang::lang('texts.Edit').'</td></tr>';
|
||
else
|
||
$rows[$i + 1] = '<tr><td style="width:400px">'.$ret.url_lang::lang('texts.'.$group->name).'</td><td style="width:30px; text-align: center" >'.$count.'</td><td>'.html::anchor(url_lang::base().'access_rights/edit_group/'.$group->id,url_lang::lang('texts.Edit')).'</td></tr>';
|
||
$groups->next();
|
||
}
|
||
if ($group->id == 21)
|
||
$rows[$i + 1] = '<tr><td style="width:400px">'.$ret.url_lang::lang('texts.'.$group->name).'</td><td style="width:30px; text-align: center" >'.$count.'</td><td>'.url_lang::lang('texts.Edit').'</td></tr>';
|
||
else
|
||
$rows[$i + 1] = '<tr><td style="width:400px">'.$ret.url_lang::lang('texts.'.$group->name).'</td><td style="width:30px; text-align: center" >'.$count.'</td><td>'.html::anchor(url_lang::base().'access_rights/edit_group/'.$group->id,url_lang::lang('texts.Edit')).'</td></tr>';
|
||
$groups->next();
|
||
}
|
||
|
||
//vykresleni
|
||
$view = new View('main');
|
||
$links[] = html::anchor(url_lang::base().'access_rights/show_groups', url_lang::lang('texts.Groups of users'));
|
||
$links[] = html::anchor(url_lang::base().'access_rights/show_acl', url_lang::lang('texts.Access control list items'));
|
||
|
||
//vykresleni
|
||
$view = new View('main');
|
||
$view->title = url_lang::lang('texts.Access Rights');
|
||
$view->content = new View('access_rights/show_groups');
|
||
$view->content->rows = $rows;
|
||
$view->content->headline = url_lang::lang('texts.Access Rights');
|
||
$view->render(TRUE);
|
||
}
|
||
$view->content->links = implode(' | ', $links);
|
||
$view->content->rows = $rows;
|
||
$view->content->headline = url_lang::lang('texts.Access Rights');
|
||
$view->render(TRUE);
|
||
}
|
||
|
||
|
||
|
||
|
||
function edit_group($group_id = NULL)
|
||
{
|
||
function edit_group($group_id = NULL)
|
||
{
|
||
|
||
if(!$this->acl_check_edit('Settings_Controller', 'access_rights'))
|
||
Controller::Error(ACCESS);
|
||
if (!isset($group_id))
|
||
Controller::warning(PARAMETER);
|
||
else
|
||
{ //kontrola jestli je paramets cislo
|
||
if (!is_numeric($group_id))
|
||
Controller::error(4);
|
||
if(!$this->acl_check_edit('Settings_Controller', 'access_rights'))
|
||
Controller::Error(ACCESS);
|
||
if (!isset($group_id))
|
||
Controller::warning(PARAMETER);
|
||
else
|
||
{ //kontrola jestli je paramets cislo
|
||
if (!is_numeric($group_id))
|
||
Controller::error(4);
|
||
|
||
//me skupine "vsichni lide na svete se nepristupuje"
|
||
if ($group_id == 21)
|
||
url::redirect(url_lang::base().'access_rights/show_groups');
|
||
//me skupine "vsichni lide na svete se nepristupuje"
|
||
if ($group_id == 21)
|
||
url::redirect(url_lang::base().'access_rights/show_groups');
|
||
|
||
//kontrola existencew cisla skupiny
|
||
$aro_group_model = new Aro_group_Model();
|
||
$group = $aro_group_model->get_by_id($group_id);
|
||
if ($group->count() == 0)
|
||
Controller::error(4);
|
||
}
|
||
//kontrola existencew cisla skupiny
|
||
$aro_group_model = new Aro_group_Model();
|
||
$group = $aro_group_model->get_by_id($group_id);
|
||
if ($group->count() == 0)
|
||
Controller::error(4);
|
||
}
|
||
|
||
$model_aro = new Aro_Model();
|
||
$model_aro = new Aro_Model();
|
||
|
||
//po zmacknuti tlacitka X se nastavi filtr na NULL
|
||
if ($this->input->post('search_system_clear'))
|
||
$search_system_input = NULL;
|
||
else
|
||
$search_system_input = $this->input->post('search_system_input');
|
||
//po zmacknuti tlacitka X se nastavi filtr na NULL
|
||
if ($this->input->post('search_system_clear'))
|
||
$search_system_input = NULL;
|
||
else
|
||
$search_system_input = $this->input->post('search_system_input');
|
||
|
||
//po zmacknuti tlacitka X se nastavi filtr na NULL
|
||
if ($this->input->post('search_group_clear'))
|
||
$search_group_input = NULL;
|
||
else
|
||
$search_group_input = $this->input->post('search_group_input');
|
||
//po zmacknuti tlacitka X se nastavi filtr na NULL
|
||
if ($this->input->post('search_group_clear'))
|
||
$search_group_input = NULL;
|
||
else
|
||
$search_group_input = $this->input->post('search_group_input');
|
||
|
||
//pridani uzivatele do skupiny
|
||
if ($this->input->post('add') != NULL && $this->input->post('system_users') != NULL)
|
||
{
|
||
$aro_id = implode("" ,$this->input->post('system_users'));
|
||
//pridani uzivatele do skupiny
|
||
if ($this->input->post('add') != NULL && $this->input->post('system_users') != NULL)
|
||
{
|
||
$aro_id = implode("" ,$this->input->post('system_users'));
|
||
|
||
$model_groups_aro_map = new Groups_Aro_Map_Model();
|
||
if (!$model_groups_aro_map->exist_row($group_id, $aro_id))
|
||
$model_groups_aro_map->insert_data(array( 'group_id' => $group_id, 'aro_id' => $aro_id ));
|
||
}
|
||
$model_groups_aro_map = new Groups_Aro_Map_Model();
|
||
if (!$model_groups_aro_map->exist_row($group_id, $aro_id))
|
||
$model_groups_aro_map->insert_data(array( 'group_id' => $group_id, 'aro_id' => $aro_id ));
|
||
}
|
||
|
||
//pridani uzivatele do skupiny
|
||
if ($this->input->post('remove') != NULL && $this->input->post('group_users') != NULL)
|
||
{
|
||
$aro_id = implode("" ,$this->input->post('group_users'));
|
||
//pridani uzivatele do skupiny
|
||
if ($this->input->post('remove') != NULL && $this->input->post('group_users') != NULL)
|
||
{
|
||
$aro_id = implode("" ,$this->input->post('group_users'));
|
||
|
||
$model_groups_aro_map = new Groups_Aro_Map_Model();
|
||
if ($model_groups_aro_map->exist_row($group_id, $aro_id))
|
||
$model_groups_aro_map->detete_row($group_id, $aro_id);
|
||
}
|
||
$model_groups_aro_map = new Groups_Aro_Map_Model();
|
||
if ($model_groups_aro_map->exist_row($group_id, $aro_id))
|
||
$model_groups_aro_map->detete_row($group_id, $aro_id);
|
||
}
|
||
|
||
//nacteni dat z databaze a filtrem nebo bez
|
||
if ($search_system_input != NULL)
|
||
$users1 = $model_aro->get_all_not_in_by_aro_broup_id($group_id, $search_system_input);
|
||
else
|
||
$users1 = $model_aro->get_all_not_in_by_aro_broup_id($group_id);
|
||
//nacteni dat z databaze a filtrem nebo bez
|
||
if ($search_system_input != NULL)
|
||
$users1 = $model_aro->get_all_not_in_by_aro_broup_id($group_id, $search_system_input);
|
||
else
|
||
$users1 = $model_aro->get_all_not_in_by_aro_broup_id($group_id);
|
||
|
||
//nacteni dat z databaze a filtrem nebo bez
|
||
if ($search_group_input != NULL)
|
||
$users2 = $model_aro->get_all_by_aro_broup_id($group_id, $search_group_input);
|
||
else
|
||
$users2 = $model_aro->get_all_by_aro_broup_id($group_id);
|
||
//nacteni dat z databaze a filtrem nebo bez
|
||
if ($search_group_input != NULL)
|
||
$users2 = $model_aro->get_all_by_aro_broup_id($group_id, $search_group_input);
|
||
else
|
||
$users2 = $model_aro->get_all_by_aro_broup_id($group_id);
|
||
|
||
//osetruje stav kdy v zadne skupine neni zadny uzivatel. Teoreticky nikdy nenastane
|
||
if (($users1->count() == 0) && ($users2->count() == 0))
|
||
Controller::error(4);
|
||
//osetruje stav kdy v zadne skupine neni zadny uzivatel. Teoreticky nikdy nenastane
|
||
if (($users1->count() == 0) && ($users2->count() == 0))
|
||
Controller::error(4);
|
||
|
||
//generovani system dropboxu
|
||
if ($users1->count() == 0)
|
||
{
|
||
$system_users_select = form::dropdown(array('name' => 'system_users[]','size' => 20, 'style'=>'width:250px'));
|
||
}
|
||
else
|
||
{
|
||
foreach($users1 as $user1)
|
||
{
|
||
$system_users[$user1->id] = $user1->name;
|
||
}
|
||
$system_users_select = form::dropdown(array('name' => 'system_users[]','size' => 20, 'style'=>'width:250px'), $system_users);
|
||
//generovani system dropboxu
|
||
if ($users1->count() == 0)
|
||
{
|
||
$system_users_select = form::dropdown(array('name' => 'system_users[]','size' => 20, 'style'=>'width:250px'));
|
||
}
|
||
else
|
||
{
|
||
foreach($users1 as $user1)
|
||
{
|
||
$system_users[$user1->id] = $user1->name;
|
||
}
|
||
$system_users_select = form::dropdown(array('name' => 'system_users[]','size' => 20, 'style'=>'width:250px'), $system_users);
|
||
|
||
}
|
||
}
|
||
|
||
//generovani system searchboxu
|
||
$system_users_search_box = '<table><tr><td>'.form::input('search_system_input', $search_system_input, 'style="width:175px;"').'</td><td>'.form::submit('search_system_submit', url_lang::lang('texts.Search'), 'style="width:50px;"').'</td><td>'.(($search_system_input == NULL )?'':form::submit('search_system_clear', 'X', 'style="width:18px;"')).'</td></tr></table>';
|
||
//generovani system searchboxu
|
||
$system_users_search_box = '<table><tr><td>'.form::input('search_system_input', $search_system_input, 'style="width:175px;"').'</td><td>'.form::submit('search_system_submit', url_lang::lang('texts.Search'), 'style="width:50px;"').'</td><td>'.(($search_system_input == NULL )?'':form::submit('search_system_clear', 'X', 'style="width:18px;"')).'</td></tr></table>';
|
||
|
||
//generovani group dropboxu
|
||
if ($users2->count()==0)
|
||
{
|
||
$group_users_select = form::dropdown(array('name' => 'group_users[]','size' => 20, 'style'=>'width:250px'));
|
||
}
|
||
else
|
||
{
|
||
foreach($users2 as $user2)
|
||
{
|
||
$group_users[$user2->id] = $user2->name;
|
||
}
|
||
//generovani group dropboxu
|
||
if ($users2->count()==0)
|
||
{
|
||
$group_users_select = form::dropdown(array('name' => 'group_users[]','size' => 20, 'style'=>'width:250px'));
|
||
}
|
||
else
|
||
{
|
||
foreach($users2 as $user2)
|
||
{
|
||
$group_users[$user2->id] = $user2->name;
|
||
}
|
||
|
||
$group_users_select = form::dropdown(array('name' => 'group_users[]','size' => 20, 'style'=>'width:250px'), $group_users);
|
||
}
|
||
$group_users_select = form::dropdown(array('name' => 'group_users[]','size' => 20, 'style'=>'width:250px'), $group_users);
|
||
}
|
||
|
||
//generovani group searchboxu
|
||
$group_users_search_box = '<table><tr><td>'.form::input('search_group_input', $search_group_input, 'style="width:175px;"').'</td><td>'.form::submit('search_group_submit', url_lang::lang('texts.Search'), 'style="width:50px;"').'</td><td>'.(($search_group_input == NULL )?'':form::submit('search_group_clear', 'X', 'style="width:18px;"')).'</td></tr></table>';
|
||
//generovani group searchboxu
|
||
$group_users_search_box = '<table><tr><td>'.form::input('search_group_input', $search_group_input, 'style="width:175px;"').'</td><td>'.form::submit('search_group_submit', url_lang::lang('texts.Search'), 'style="width:50px;"').'</td><td>'.(($search_group_input == NULL )?'':form::submit('search_group_clear', 'X', 'style="width:18px;"')).'</td></tr></table>';
|
||
|
||
//tlacitka pro manipulaci
|
||
$add_button = form::submit('add', url_lang::lang('texts.Add').' ►', 'style="width:80px;"');
|
||
//tlacitka pro manipulaci
|
||
$add_button = form::submit('add', url_lang::lang('texts.Add').' ►', 'style="width:80px;"');
|
||
|
||
$remove_button = form::submit('remove', '◄ '.url_lang::lang('texts.Remove'), 'style="width:80px;"');
|
||
$remove_button = form::submit('remove', '◄ '.url_lang::lang('texts.Remove'), 'style="width:80px;"');
|
||
|
||
$aro_group_model = new Aro_group_Model();
|
||
$name = $aro_group_model->get_by_id($group_id);
|
||
$aro_group_model = new Aro_group_Model();
|
||
$name = $aro_group_model->get_by_id($group_id);
|
||
|
||
$headline = url_lang::lang('texts.Edit group').': '.url_lang::lang('texts.'.$name->current()->name);
|
||
$view = new View('main');
|
||
$headline = url_lang::lang('texts.Edit group').': '.url_lang::lang('texts.'.$name->current()->name);
|
||
$view = new View('main');
|
||
$view->title = $headline;
|
||
$view->content = new View('access_rights/edit_group');
|
||
$view->content->headline = $headline;
|
||
$view->content->system_users_select = $system_users_select;
|
||
$view->content->system_users_search_box = $system_users_search_box;
|
||
$view->content->group_users_select = $group_users_select;
|
||
$view->content->group_users_search_box = $group_users_search_box;
|
||
$view->content->add_button = $add_button;
|
||
$view->content->remove_button = $remove_button;
|
||
$view->render(TRUE);
|
||
}
|
||
}
|
||
$view->content->headline = $headline;
|
||
$view->content->system_users_select = $system_users_select;
|
||
$view->content->system_users_search_box = $system_users_search_box;
|
||
$view->content->group_users_select = $group_users_select;
|
||
$view->content->group_users_search_box = $group_users_search_box;
|
||
$view->content->add_button = $add_button;
|
||
$view->content->remove_button = $remove_button;
|
||
$view->render(TRUE);
|
||
}
|
||
|
||
function count_parent($id)
|
||
{
|
||
$aro_group_model = new Aro_group_Model();
|
||
function count_parent($id)
|
||
{
|
||
$aro_group_model = new Aro_group_Model();
|
||
|
||
$parent = $aro_group_model->get_parent_id_by_id($id);
|
||
$parent = $aro_group_model->get_parent_id_by_id($id);
|
||
|
||
if ($parent->count() == 0)
|
||
return 0;
|
||
else
|
||
return (1 + count_parent($parent->current()->parent_id));
|
||
if ($parent->count() == 0)
|
||
return 0;
|
||
else
|
||
return (1 + $this->count_parent($parent->current()->parent_id));
|
||
}
|
||
|
||
/**
|
||
* Shows access control list. Each ACL item has shown its access control objects (ACO) and
|
||
* access extension objects (AXO).
|
||
* @TODO Some items in database are in english, some in czech. It would be good to adhere convention.
|
||
* So all names in database should be in english and translations to other languages should be done
|
||
* in i18n/texts.php file using url_lang::lang method.
|
||
* @author Jiri Svitak
|
||
* @return unknown_type
|
||
*/
|
||
function show_acl()
|
||
{
|
||
if (!$this->acl_check_view('Settings_Controller', 'access_rights'))
|
||
Controller::Error(ACCESS);
|
||
$acl_model = new Acl_Model();
|
||
$axo_model = new Axo_Model();
|
||
$aco_model = new Aco_Model();
|
||
$acls = $acl_model->get_acl();
|
||
foreach($acls as $key => $acl)
|
||
{
|
||
$allow = $acl->allow ? url_lang::lang('texts.Allow') : url_lang::lang('texts.Deny');
|
||
$acl_line = "<tr><th>$acl->acl_id</th><th>$acl->note</th><th>".$allow."</th></tr>\n";
|
||
$acos = $aco_model->get_aco_by_acl($acl->acl_id);
|
||
$aco_line = '';
|
||
foreach ($acos as $aco)
|
||
{
|
||
$aco_line .= "<tr><th></th><th>".url_lang::lang('texts.'.$aco->name)."</th><th></th></tr>\n";
|
||
}
|
||
$axos = $axo_model->get_axo_by_acl($acl->acl_id);
|
||
$axo_line = '';
|
||
foreach ($axos as $axo)
|
||
{
|
||
$axo_line .= "<tr><td>$axo->id</td><td>".url_lang::lang('texts.'.$axo->name)."</td><td>$axo->section_value</td></tr>\n";
|
||
}
|
||
$empty_line = "<tr></tr>\n";
|
||
$rows[$key] = $acl_line.$aco_line.$axo_line.$empty_line;
|
||
}
|
||
$links[] = html::anchor(url_lang::base().'access_rights/show_groups', url_lang::lang('texts.Groups of users'));
|
||
$links[] = html::anchor(url_lang::base().'access_rights/show_acl', url_lang::lang('texts.Access control list items'));
|
||
$view = new View('main');
|
||
$view->title = url_lang::lang('texts.Access Rights');
|
||
$view->content = new View('access_rights/show_groups');
|
||
$view->content->links = implode(' | ', $links);
|
||
$view->content->rows = $rows;
|
||
$view->content->headline = url_lang::lang('texts.Access Rights');
|
||
$view->render(TRUE);
|
||
}
|
||
|
||
}
|
||
|
||
?>
|
freenetis/trunk/kohana/application/views/access_rights/show_groups.php | ||
---|---|---|
<h2><?php echo $headline ?></h2>
|
||
<?php echo isset($links) ? '<br />'.$links : '' ?>
|
||
<br /><br />
|
||
<div>
|
||
<table class="extended" style="float:left">
|
freenetis/trunk/kohana/application/views/members_show.php | ||
---|---|---|
<?php if (isset($expiration_date)) { ?>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Payed to')?></th>
|
||
<td><?php echo date('Y-m-d') < $expiration_date ? $expiration_date : '<span style="color:red">'.url_lang::lang('texts.You are in debt').'</span>' ?></td>
|
||
<td><?php echo $expiration_date ?></td>
|
||
</tr>
|
||
<?php } ?>
|
||
<tr>
|
freenetis/trunk/kohana/application/views/transfers/show_by_account.php | ||
---|---|---|
<th><?php echo url_lang::lang('texts.Variable symbol')?></th>
|
||
<td><?php echo $account->member->variable_symbol ?></td>
|
||
</tr>
|
||
<?php if (isset($expiration_date)) { ?>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Payed to')?></th>
|
||
<td><?php echo date('Y-m-d') < $expiration_date ? $expiration_date : '<span style="color:red">'.url_lang::lang('texts.You are in debt').'</span>' ?></td>
|
||
</tr>
|
||
<?php } ?>
|
||
<?php if (isset($expiration_date)) { ?>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Payed to')?></th>
|
||
<td><?php echo $expiration_date ?></td>
|
||
</tr>
|
||
<?php } ?>
|
||
<?php } ?>
|
||
</table>
|
||
<br class="clear" />
|
||
<br />
|
Také k dispozici: Unified diff
Opraven vypocet data vyprseni kreditu clena. Pridan nahled na ACL prava spolu s jejich ACO a AXO objekty, muze takto slouzit jako nahrada phpgacladmina. Pridana prava pro VoIP, pouze v kodu, v databazi uz byla. Potreba provest detailni testovani funkcnosti prav.