Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 2497

Přidáno uživatelem David Raška před asi 9 roky(ů)

Upravy:
refs #908: Zmena zpusobu zobrazeni overen/neoveren
Overovani pres odkaz v e-mailu
Moznost zaslani overovaciho e-mailu hned pri vytvoreni uzivatele
Pridany napovedy
Uprava DB upgrade

Zobrazit rozdíly:

freenetis/branches/1.2/application/controllers/contacts.php
$grid_contacts->callback_field('type')
->callback('callback::additional_contacts_type_callback');
$grid_contacts->callback_field('verify')
->label('Verified contact')
->class('center')
->callback('callback::enabled_field');
$grid_contacts->field('value');
$grid_contacts->callback_field('value')
->callback('callback::verified_contact')
->help(help::hint('verified_contact'));
$actions = $grid_contacts->grouped_action_field();
......
}
$country_model->transaction_commit();
try
if (module::e('email'))
{
$this->send_verify_message($contact_model->id);
status::success('Verification message have been successfully sent.');
try
{
$this->send_verify_message($contact_model->id);
status::success('Verification message have been successfully sent.');
}
catch (Exception $ex)
{
status::error('Error - cant send Verification message', $ex);
Log::add_exception($ex);
}
}
catch (Exception $ex)
{
status::error('Error - cant send Verification message', $ex);
Log::add_exception($ex);
}
status::success('Additional contacts have been successfully updated');
$this->redirect('contacts/show_by_user/',$user_id);
......
// ok
$contact_model->transaction_commit();
if ($changed)
if ($changed && module::e('email'))
{
try
{
......
* @param type $user_id
* @param type $contact_id
*/
public function verify($contact_id = NULL)
public function verify($contact_id = NULL, $verify = 0)
{
if (empty($contact_id) || !is_numeric($contact_id))
{
......
{
Controller::error(ACCESS);
}
$view = new View('main');
$view->title = __('Administration of additional contacts');
$view->title = __('Verify contact');
$enum_type_model = new Enum_type_Model();
$country_code = NULL;
......
$form2->submit('Send verify message');
if (!module::e('email'))
{
$form2->inputs[0]->disabled('disabled');
$form2->inputs[0]->title(__('E-mail module is required to send verification message.'));
}
if ($verify == 1)
{
$contact_model->transaction_start();
// contact
$contact_model->verify = 1;
$contact_model->save_throwable();
// ok
$contact_model->transaction_commit();
status::success('Contact have been successfully verified');
$this->redirect('contacts/show_by_user/'.$user_id);
}
if ($form->validate())
{
if (isset($_GET) && isset($_GET['verify']))
......
status::error('Error - cant verify additional contact', $ex);
Log::add_exception($ex);
}
$this->redirect('contacts/show_by_user/', $user_id);
$this->redirect(Path::instance()->previous());
}
else
{
try
if (module::e('email'))
{
if ($contact_model->verify == 0)
try
{
$contact_model->verify = text::random('numeric', 6);
$this->send_verify_message($contact_id);
status::success('Verification message have been successfully sent.');
}
$this->send_verify_message($contact_id);
status::success('Verification message have been successfully sent.');
catch (Exception $ex)
{
status::error('Error - cant send verification message', $ex);
Log::add_exception($ex);
}
}
catch (Exception $ex)
{
status::error('Error - cant send verification message', $ex);
Log::add_exception($ex);
}
$this->redirect('contacts/show_by_user/', $user_id);
$this->redirect(Path::instance()->previous());
}
}
else
......
);
$view->content->country_code = $country_code;
$view->content->value = $contact_model->value;
$view->content->verified = $contact_model->verify;
$view->render(TRUE);
}
}
......
* @param mixed $user_id
* @param mixed $contact_id
*/
private function send_verify_message($contact_id)
public function send_verify_message($contact_id)
{
$contact_model = new Contact_Model($contact_id);
$message_model = new Message_Model();
if ($contact_model->verify == 1)
{
return;
......
where('type', Message_Model::VERIFY_CONTACT_MESSAGE)->find();
$data = $contact_model->get_message_info_by_contact_id($contact_id)->current();
$data->verify_link = url_lang::site('contacts/verify/'.$contact_id, FALSE, FALSE);
$data->verify_link = url_lang::site('contacts/verify/'.$contact_id.'/1', FALSE, FALSE);
if ($contact_model->type == Contact_Model::TYPE_EMAIL)
{
freenetis/branches/1.2/application/controllers/members.php
$form->input('email')
->rules('valid_email')
->class('join1')
->callback(array($this, 'valid_unique_email'))
->style('width:250px');
$form->checkbox('send_verify_email')
->label('Send verify message')
->class('join2 checkbox');
if (Settings::get('finance_enabled'))
{
......
$contact_model->add($user);
$contact_model->save_throwable();
}
if ($form_data['send_verify_email'])
{
try
{
$cc = new Contacts_Controller();
$cc->send_verify_message($contact_model->id);
status::success('Verification message have been successfully sent.');
}
catch (Exception $ex)
{
status::error('Error - cant send Verification message', $ex);
Log::add_exception($ex);
}
}
}
// saving account
freenetis/branches/1.2/application/helpers/callback.php
}
}
}
public static function verified_contact($item , $name)
{
if ($item->type == Contact_Model::TYPE_EMAIL)
{
if ($item->verify == 1)
{
echo "<span class=\"more\" title=\"".__('Contact verified')."\">" . $item->value."</span>";
}
else
{
echo "<span class=\"more notverified\" title=\"".__('Contact not verified')."\">" . $item->value."</span>";
}
return;
}
echo $item->value;
}
/**
* Callback function to print VLANS count with preview of names
freenetis/branches/1.2/application/i18n/cs_CZ/help.php
'self_cancel_text' => 'Text pro odkaz určený k zrušení přesměrování členem. Tento text se zobrazuje v patičce stránky přesměrovanému členovi.',
'self_cancel_url' => 'Je to adresa na centrální bráně, na které běží lighthttpd web server. Pravidla firewallu na centrální bráně takto poznají uživatelův úmysl ukončit přesměrování. Stránka tedy může obsahovat stručnou informaci pro uživatele o ukončení přesměrování a případný rozcestník.',
'send_as_form' => 'Odešle parametry v odkazu metodou POST. Položky zadávejte stejně jako v případě metody GET, např.<br/>http://{ip_address}?username={login}&pass={password}',
'send_verification_message' => 'Odešle uživateli zprávu s odkazem pro ověření kontaktu.',
'service' => 'Je-li pro tuto IP adresu zapnuta služba, pak je tato IP adresa využívána pro Radius. Typicky jde o IP adresy aktivních síťových prvků, na které je se možné pomocí Radiusu přihlásit.',
'set_whitelist_to_member' => 'Trvalá bílá listina je seznam členů, pro které neplatí přesměrování. Jde například o důležitou partnerskou instituci zapojenou do sítě, například městský úřad apod. Všechna systémová přesměrování tedy nemohou ve výchozím stavu obtěžovat počítače s IP adresou na bílé listině. Lze ovšem vytvořit takové zprávy, které budou ignorovat tuto listinu, např. informování o nadcházejícím výpadku. Pro dočasnou bílou listinu platí to samé, ale IP adresy v ní jsou po určeném čase z této listiny mazány. Např. uživatel byl přesměrován kvůli neplacení a chceme mu umožnit krátkodobý přístup na internet do internetového bankovnictví.',
'sms_driver_klikniavolej' => 'Klikniavolej.cz je internetová služba, která zproztředkovává zasílání SMS skrze softwárové rozhraní. Pro aktivaci tohoto ovladače se musíte zaregistrovat na <a href=\'http://klikniavolej.cz\' target=\'_blank\'>http://klikniavolej.cz</a> jako firemní zákazník a poté aktivujte SMS bránu dle instrukcí <a href=\'http://www.klikniavolej.cz/faq.asp#WhoSaleSMS_Info\' target=\'_blank\'>zde</a>. Číselný identifikátor, který Vám bude vygenerován potom vložte do pole &quot;uživatel&quot;.',
......
'url_pattern' => 'Podle šablony url bude vygenerován výsledný odkaz. Můžete využít speciálních tagů:<br/>{ip_address} - bude nahrazen IP adresou zařízení<br/>{gateway_ip} - bude nahrazen IP adresou brány<br/>{login} - bude nahrazen přihlašovacím jménem<br/>{password} - bude nahrazen heslem',
'url_settings' => 'Změnou těchto proměnných nemusíte přímo ovlivnit konfiguraci FreenetISu na serveru. Pro změnu konfigurace je nutné změnit konfiguraci pro webový server Apache. Např. při instalaci z balíčkovacích systémů spusťte příkaz <code>dpkg-reconfigure freenetis</code> a vyplňte údaje shodně s údaji zadanými v tomto formuláři.',
'variable_symbol' => 'Variabilní symbol slouží k jednoznačnému určení příchozí platby člena.',
'verified_contact' => 'Ověřený kontakt znamená, že na zadaný kontakt byla zaslána zpráva s ověřením, uživatel tuto zprávu potvrdil a tudíž je kontakt platný.',
'verify_contact' => 'Ověří kontakt ihned bez posílání ověřovací zprávy uživateli.',
'voip_login_data' => 'Níže uvedené údaje využijte pro nastavení vašeho VoIP telefonu. Login použijte pro požadované přihlašovací či zobrazovací jméno, heslo pro heslo k účtu a adresa proxy serveru odpovídá adrese telefonní ústředny. Údaj CLIPS je jen dodatečná informace pro příjemce hovoru, pokud vás nemá v seznamu. Doporučujeme nastavit stejné jako je vaše číslo.',
'voip_status' => 'Stav Registrovaný znamená, že telefonní klient ať už fyzický či softwarový je zapnut a správně připojen k ústředně. Stav Neregistrovaný platí pro opak. Pro VoIP telefon registrovaný v ústředně se pak zobrazuje jeho aktuální IP adresa, port a čas vypršení registrace.',
'whitelist' => 'Členům, kteří jsou umístěny na bílé listině, je sice možné aktivovat přesměrování (upozornění), ale nebudou odeslány na centrální router (odeslány zprávy). Tedy nebudou přesměrovány (upozorněni), dokud nebudou odebráni z bílé listiny. Dočasná bílá listina se od trvalé liší v tom, že je stanovena jen pro určitý časový interval.',
freenetis/branches/1.2/application/i18n/cs_CZ/texts.php
'contact has been deleted' => 'Kontakt byl smazán.',
'contact information' => 'Kontaktní informace',
'contact list on redirect page' => 'Kontaktní informace na stránce přesměrování',
'contact not verified' => 'Kontakt neověřen',
'contact value' => 'Data kontaktu',
'contact verified' => 'Kontakt ověřen',
'contacts' => 'Kontakty',
'contains' => 'obsahuje',
'contains not' => 'neobsahuje',
......
'e-mail do not match with data in information system' => 'E-mail nesouhlasí s údaji v informačním systému',
'e-mail has been successfully sent' => 'E-mail byl úspěšně odeslán',
'e-mail has been sent for %s e-mail addresses' => 'E-mail byl odeslán pro %s e-mailových adres',
'e-mail module is required to send verification message' => 'Module E-mail je vyžadován pro zaslání ověřovací zprávy.',
'e-mail settings' => 'Nastavení e-mailu',
'e-mail subject prefix' => 'Předpona předmětu e-mailu',
'e-mail variables' => 'Proměnné e-mailu',
......
'send mail warning to users related with invoice' => 'Odeslat upozornění uživatelům spojených s fakturou',
'send message' => 'Odeslat zprávu',
'send sms notice about received payment to member' => 'Odeslat členovi SMS zprávu s oznámením o jeho přijaté platbě',
'send verify message' => 'Odelat ověřovací zprávu',
'send verify message' => 'Odeslat ověřovací zprávu',
'select' => 'Vyber',
'select account type' => 'Vyber typ účtu',
'select action' => 'Vyber činnost',
freenetis/branches/1.2/application/i18n/en_US/help.php
'self_cancel_text' => 'The text for link is designed to cancel mamber redirection. This text is displayed in the bottom of the page redirected member.',
'self_cancel_url' => 'It addresses the central gate, which runs lighthttpd web server. Firewall rules on the central gate thus identify the user\'s intention to terminate redirection. Page therefore may contain brief information for the user to terminate any links and redirects.',
'send_as_form' => 'Sends parameters in link using POST method. Enter items as in GET method, e.g.<br/>http://{ip_address}?username={login}&pass={password}',
'send_verification_message' => 'Sends message to user with link for contact verification.',
'service' => 'If the IP address for this service is enabled, then this IP address used for the Radius. Typically, these IP addresses of active network elements on which it is possible to log on via Radius.',
'set_whitelist_to_member' => 'Permanent white list is a list of members for which it does not redirect. This is such an important partner institution involved in the network, such as municipal authorities, etc. Any diversion system is not in default bother computer with an IP address on the white list. But you can create a message that will ignore this list, such as informing of impending failure. For temporary whitelist does the same, but IP addresses in it after a specified time from the instrument clean. Eg. user was redirected due to non-payment and we want him to allow short-term Internet access to internet banking.',
'sms_driver_klikniavolej' => 'Klikniavolej.cz is an internet service that provide sending SMS through a software interface. To activate the driver you must register at <a href=\'http://klikniavolej.cz\' target=\'_blank\'>http://klikniavolej.cz</a> as a corporate customer and then activate the SMS gateway using instructions that may be found <a href=\'http://www.klikniavolej.cz/faq.asp#WhoSaleSMS_Info\' target=\'_blank\'>here</a>. The numeric identifier that will be generated for you must be put into the "user" field.',
......
'url_pattern' => 'Link will be generated from url pattern. You can use special tags:<br/>{ip_address} - will be replaced by device IP address{gateway_ip} - will be replaced by gateway IP address<br/>{login} - will be replaced by login name<br/>{password} - will be replaced by login password',
'url_settings' => 'By changing of this variables the configuration of the FreenetIS on this server may not be directly affected. To change the configuration, it\'s necessarily to change the configuration of the Apache web server. E.g. when installing from packaging system, run command <code>dpkg-reconfigure freenetis</code> and fill with same values as you have in this form.',
'variable_symbol' => 'Variable symbol is used to unambiguously determine the incoming payments member.',
'verified_contact' => 'Verified contact means, that verification message has been sent to this contact, user confirmed this message and therefore this contact is fully working.',
'verify_contact' => 'Verifies contact immediately without sending any message to user.',
'voip_login_data' => 'Following settings are used to set up your VoIP phone. Login is for your login name or display name, password is for your account password and proxy server address is address of your telephone exchange. We recommend setting CLIP the same as your phone number. CLIP is displayed to receiver as your additional identification.',
'voip_status' => 'State Registered means that client either hardware or software is turned on and correctly connected to telephone exchange. Otherwise the state is Unregistered. For successfully registered VoIP phone is shown its IP address, port and timeout of registration.',
'whitelist' => 'Members, whose are located on the white list, you may be able to activate the redirect (notification), but not sent to the central router (messages sended). Will not be diverted until removed from the white list. Temporary White List from the persistent differ in that it is valid just for a specified time interval.',
freenetis/branches/1.2/application/libraries/forge/Form_Date.php
$this->parent_form = &$form;
$this->parent_form->checkbox($this->data['name']."_infinity")
->class("join2 infinitycheckbox")
->class("join2 checkbox")
->label("Unlimited");
// add infinity rule as first
freenetis/branches/1.2/application/models/message.php
const FORMER_MEMBER_MESSAGE = 19;
/**
* notification e-mail
* content of e-mail for contact verification
*/
const VERIFY_CONTACT_MESSAGE = 20;
......
$type != self::MONITORING_HOST_DOWN &&
$type != self::MONITORING_HOST_UP &&
$type != self::INTERRUPTED_MEMBERSHIP_BEGIN_NOTIFY_MESSAGE &&
$type != self::INTERRUPTED_MEMBERSHIP_END_NOTIFY_MESSAGE
$type != self::INTERRUPTED_MEMBERSHIP_END_NOTIFY_MESSAGE &&
$type != self::VERIFY_CONTACT_MESSAGE
);
}
freenetis/branches/1.2/application/views/contacts/verify.php
<th><?php echo __('Value') ?>:</th>
<td><b><?php echo $value; ?></b></td>
</tr>
<tr>
<th><?php echo __('Verified') ?>: <?php echo help::hint('verified_contact'); ?></th>
<td><b><?php echo ($verified ? __('Yes') : __('No')) ?></b></td>
</tr>
</table>
<?php echo $form; ?>
<?php echo $form2; ?>
<div>
<div class="submit_hint"><?php echo $form; ?></div>
<div class="submit_hint"><?php echo help::hint('verify_contact'); ?></div>
</div>
<div>
<div class="submit_hint"><?php echo $form2; ?></div>
<div class="submit_hint"><?php echo help::hint('send_verification_message'); ?></div>
</div>
freenetis/branches/1.2/application/views/members/show.php
<th>
<table class="picturebox">
<tr>
<td><?php echo __('E-mail') .' - ' . ($contact->verify == 1 ? __('Verified') : __('Not verified')) ?></td>
<td><?php echo __('E-mail') ?></td>
<td><?php if (Settings::get('email_enabled')):
echo form::open(url_lang::base().'email') ;
echo form::hidden('email_member_id', $member->id );
......
</tr>
</table>
</th>
<td><?php echo $contact->value ?></td>
<td><?php if ($contact->verify == 1): ?>
<span class="more" title="<?php echo __('Contact verified')?>"><?php echo $contact->value ?></span>
<?php else: ?>
<span class="more notverified" title="<?php echo __('Contact not verified')?>"><?php echo $contact->value ?></span>
<?php echo html::anchor('contacts/verify/'.$contact->id, html::image(array('src' => 'media/images/icons/grid_action/approve.png'), array('alt' => __('Verify contact'), 'title' => __('Verify contact'))), array('title' => __('Verify contact'), 'class' => 'popup_link action_field_icon')); ?>
<?php endif;?>
</td>
<?php else: ?>
<th><?php echo $contact_types[$i] ?></th>
<td><?php echo $contact->value ?></td>
freenetis/branches/1.2/db_upgrades/upgrade_1.2.0~alpha8.php
*/
$upgrade_sql['1.2.0~alpha8'] = array
(
"ALTER TABLE `contacts` ADD `verify` INT( 1 ) NOT NULL",
"ALTER TABLE `contacts` ADD `verify` TINYINT( 1 ) NOT NULL DEFAULT '0'",
"INSERT INTO `messages` (`id` , `name` , `text` , `email_text` , `sms_text` , `type` , `self_cancel` , `ignore_whitelist` ) VALUES
(NULL , 'Verify contact', NULL ,
'<p>Verify your contact {contact} on <a href=\"{verify_link}\" target=\"_blank\">{verify_link}</a></p>',
NULL, '20', '1', '0');"
'<p>Please, verify your FreenetIS e-mail address contact {contact} by clicking on this link: <a href=\"\{verify_link\}\" target=\"_blank\">\{verify_link\}</a></p>',
NULL, '20', '0', '1');"
); // end of $upgrade_sql['1.2.0~alpha8']
freenetis/branches/1.2/media/css/forms.css
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fe6005', endColorstr='#ff5900',GradientType=0 ); /* IE6-9 */
}
.submit:disabled {
/* background */
background: #606060; /* Old browsers */
background: -moz-linear-gradient(top, #606060 0%, #d2d2d2 1%, #595959 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#606060), color-stop(1%,#d2d2d2), color-stop(100%,#595959)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #606060 0%, #d2d2d2 1%, #595959 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #606060 0%, #d2d2d2 1%, #595959 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #606060 0%, #d2d2d2 1%, #595959 100%); /* IE10+ */
background: linear-gradient(top, #606060 0%, #d2d2d2 1%, #595959 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#606060', endColorstr='#595959',GradientType=0 ); /* IE6-9 */
}
.dropdown {
padding:2px;
freenetis/branches/1.2/media/css/style.css
margin-right: 5px;
}
input.infinitycheckbox {
input.join2.checkbox {
margin: 0px 5px 0px 10px;
width: initial;
}
......
border-bottom: 1px dotted black;
}
.more.notverified {
color: red;
font-weight: bold;
border-color: red;
vertical-align: super;
}
.submit_hint {
display: inline-block;
}
.submit_hint > img.help_hint {
padding: 0px 5px;
top: 7px;
position: relative;
}
.ui-widget-header {
border-width: 0px ! important;
border-bottom-width: 1px ! important;

Také k dispozici: Unified diff