Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 441

Přidáno uživatelem Jiří Sviták před asi 15 roky(ů)

Opravena chyba pri zobrazovani zarizeni, zahajena prace na presmerovani na centralnim routeru.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php
'rating' => 'Ohodnocení',
'really delete this account' => 'Opravdu smazat tento účet',
'received member fees' => 'Přijaté členské příspěvky',
'redirect as debtor' => 'Přesměrovat jako dlužníka',
'reg' => 'Přih.',
'register' => 'Registrovat',
'registration' => 'Přihláška',
freenetis/trunk/kohana/application/models/member.php
{
return self::$db->query("SELECT quarter FROM members WHERE quarter LIKE '" . $quarter . "%' GROUP BY quarter");
}
/**
* Function gets all ip address of interfaces of devices of users of given member.
* @param $member_id
* @return unknown_type
*/
public function get_ip_addresses_of_member($member_id)
{
return self::$db->query("SELECT
ip_address
FROM ip_addresses ip
JOIN ifaces i ON i.id = ip.iface_id
JOIN devices d ON d.id = i.device_id
JOIN users u ON u.id = d.user_id
JOIN members m ON m.id = u.member_id
WHERE m.id = $member_id
");
}
}
?>
freenetis/trunk/kohana/application/controllers/members.php
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
$form->group('')->label(url_lang::lang('texts.Basic information'));
$form->input('title1')->label(url_lang::lang('texts.pre title').':')->rules('length[1,40]')->value($member_data->pre_title);
if ($this->acl_check_edit('Users_Controller','name',$member_id))
$form->input('name')->label(url_lang::lang('texts.name').':')->rules('required|length[1,30]')->value($member_data->name);
$form->input('middle_name')->label(url_lang::lang('texts.middle name').':')->rules('length[1,30]')->value($member_data->middle_name);
if ($this->acl_check_edit('Users_Controller','surname',$member_id))
$form->input('surname')->label(url_lang::lang('texts.surname').':')->rules('required|length[1,60]')->value($member_data->surname);
$form->input('title2')->label(url_lang::lang('texts.post title').':')->rules('length[1,30]')->value($member_data->post_title);
//$form->input('title1')->label(url_lang::lang('texts.pre title').':')->rules('length[1,40]')->value($member_data->pre_title);
//if ($this->acl_check_edit('Users_Controller','name',$member_id))
// $form->input('name')->label(url_lang::lang('texts.name').':')->rules('required|length[1,30]')->value($member_data->name);
//$form->input('middle_name')->label(url_lang::lang('texts.middle name').':')->rules('length[1,30]')->value($member_data->middle_name);
//if ($this->acl_check_edit('Users_Controller','surname',$member_id))
// $form->input('surname')->label(url_lang::lang('texts.surname').':')->rules('required|length[1,60]')->value($member_data->surname);
//$form->input('title2')->label(url_lang::lang('texts.post title').':')->rules('length[1,30]')->value($member_data->post_title);
if ($this->acl_check_edit(get_class($this),'type',$member_id))
{
$enum_types = new Enum_type_Model();
......
$form->input('organization_identifier')->label(url_lang::lang('texts.Organization identifier').':')->rules('length[3,20]')->value($member_data->organization_identifier);
if ($this->acl_check_edit('Members_Controller', 'var_sym', $member_id))
$form->input('variable_symbol')->label(url_lang::lang('texts.Variable symbol').':')->rules('required|length[9,10]')->value($member_data->variable_symbol)->callback(array($this, 'valid_var_sym'));
/*
$form->group('')->label(url_lang::lang('texts.Login data'));
if ($this->acl_check_edit('Users_Controller','login',$member_id))
$form->input('login')->label(url_lang::lang('texts.username').':')
->rules('required|length[3,50]')
->callback(array($this, 'valid_username'))
->value($member_data->login);
*/
$form->group('')->label(url_lang::lang('texts.Address'));
if ($this->acl_check_edit(get_class($this),'address',$member_id))
......
$form->input('street_number')->label(url_lang::lang('texts.street number').':')->rules('required|length[1,50]|valid_numeric')->value($address_point->street_number);
$form->dropdown('town_id')->label(url_lang::lang('texts.town').':')->rules('required')->options($arr_towns)->selected($address_point->town_id);
}
/*
$form->group('')->label(url_lang::lang('texts.Contact information'));
if ($this->acl_check_edit('Users_Controller','phone',$member_id))
$form->input('phone')->label(url_lang::lang('texts.phone').':')->rules('required|length[3,40]')->callback(array($this, 'valid_phone'))->value($member_data->phone);
......
$form->input('email')->label(url_lang::lang('texts.email').':')
->rules('length[3,50]|valid_email')
->callback(array($this, 'valid_email'))->value($member_data->email);
*/
$form->group('')->label(url_lang::lang('texts.Account information'));
if ($this->acl_check_edit(get_class($this),'en_fee',$member_id) && ($member_data->entrance_fee == $member_data->entrance_fee_left))
......
$address_point_model = new Address_point_Model();
$address_point = $address_point_model->get_address_point($form_data['town_id'],$form_data['street_id'],$form_data['street_number']);
/*
$user_data->where('type!=', User_Model::$user);
$user_data->find_by_member_id($member_id);
*/
// user data
/*
if ($this->acl_check_edit(get_class($this),'name',$member_id))
$user_data->name = $form_data['name'];
$user_data->middle_name = $form_data['middle_name'];
......
$user_data->phone = $form_data['phone'];
if ($this->acl_check_edit('Users_Controller','email',$member_id))
$user_data->email = $form_data['email'];
*/
if ($this->acl_check_edit(get_class($this),'type',$member_id))
$member_data->type = $form_data['type'];
if ($this->acl_check_edit(get_class($this), 'organization_id', $member_id))
......
$member_data->debt_payment_rate = $form_data['debt_payment_rate'];
$member_saved = $member_data->save();
$user_data->member_id = $member_data->id;
//$user_data->member_id = $member_data->id;
/*
if ($this->acl_check_3D('freenetis', 'edit_own', 'edit_type'))
Controller::insert_phpgacl($user_data->id,$user_data->surname.' '.$user_data->name,$user_data->login,$form_data['type'], true);
*/
unset($form_data);
if ($member_saved && $user_data->save())
if ($member_saved /*&& $user_data->save()*/)
{
$this->session->set_flash('message', url_lang::lang('texts.Member has been successfully updated.'));
}
freenetis/trunk/kohana/application/controllers/redirect.php
{
url::redirect(url::base());
}
/**
* Function redirects all devices of member's users.
* Freenetis connects to gateway based on linux. IP addresses are redirected by shorewall rule in
* linux-based gateway. This is done by assigning ip addresses to "debtor" ipset. Ipset is kernel module.
* @param $member_id
* @return unknown_type
*/
function member($member_id = null)
{
if (!isset($member_id))
Controller::warning(PARAMETER);
$member_model = new Member_Model($member_id);
if ($member_model->id == 0)
Controller::error(RECORD);
// all ip addresses of interfaces of devices of users of given member
$ips = $member_model->get_ip_addresses_of_member($member_id);
foreach($ips as $ip)
{
echo $ip->ip_address.'<br>';
}
echo 'uz to bude..';
}
/**
* IP address has not been found in database.
* @param $ip_address
* @return unknown_type
*/
function ip_unknown($ip_address = NULL)
{
......
$view->render(TRUE);
}
/**
* Function provides complete information about your IP address, if it is found in database.
* @param $ip_address
* @return unknown_type
*/
function ip_info($ip_address = NULL)
{
......
$view->render(TRUE);
}
public function __call($method, $arguments)
{
url::redirect(url::base());
}
}
freenetis/trunk/kohana/application/views/show_device.php
echo ($message = $this->session->get('message')) ? '<div class="message">'.$message.'</div>' : '';
if ($this->acl_check_view(get_class($this),'devices',$device->user->id))
$links[] = html::anchor(url_lang::base().'devices/show_by_user/'.$device->user->member_id, url_lang::lang('texts.Back to devices of user'));
$links[] = html::anchor(url_lang::base().'devices/show_by_user/'.$device->user->id, url_lang::lang('texts.Back to devices of user'));
if($this->acl_check_edit(get_class($this),'devices'))
$links[] = html::anchor(url_lang::base().'devices/edit/'.$device->id, url_lang::lang('texts.Edit'));
freenetis/trunk/kohana/application/views/members/show.php
if ($this->acl_check_view('Accounts_Controller', 'transfers', $member_data->member_id) && $member_data->member_id <> 1)
$links[] = html::anchor(url_lang::base().'transfers/show_by_member/'.$member_data->member_id,url_lang::lang('texts.Show his transfers'));
$links[] = html::anchor(url_lang::base().'redirect/ip_info/', url_lang::lang('texts.My IP address'));
$links[] = html::anchor(url_lang::base().'redirect/member/'.$member_data->member_id, url_lang::lang('texts.Redirect as debtor'));
if ($member_data->member_id != 1 && $member_data->entrance_fee_left != 0 && $this->acl_check_edit('Members_Controller', 'en_fee_left', $member_data->member_id))
$links[] = html::anchor(url_lang::base().'transfers/deduct_entrance_fees/'.$member_data->member_id, url_lang::lang('texts.Deduct entrance fee'), array('onclick' => 'return potvrd(\''.url_lang::lang('texts.Do you want to deduct this member\'s entrance fee').'\')'));
echo implode (' | ', $links)

Také k dispozici: Unified diff