本文整理汇总了PHP中captcha::check方法的典型用法代码示例。如果您正苦于以下问题:PHP captcha::check方法的具体用法?PHP captcha::check怎么用?PHP captcha::check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类captcha
的用法示例。
在下文中一共展示了captcha::check方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_index
public function action_index()
{
//template header
$this->template->title = __('Contact Us');
$this->template->meta_description = __('Contact') . ' ' . core::config('general.site_name');
Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Home'))->set_url(Route::url('default')));
Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Contact Us')));
if ($this->request->post()) {
//captcha check
if (captcha::check('contact')) {
//check if user is loged in
if (Auth::instance()->logged_in()) {
$email_from = Auth::instance()->get_user()->email;
$name_from = Auth::instance()->get_user()->name;
} else {
$email_from = core::post('email');
$name_from = core::post('name');
}
//akismet spam filter
if (!core::akismet($name_from, $email_from, core::post('message'))) {
$replace = array('[EMAIL.BODY]' => core::post('message'), '[EMAIL.SENDER]' => $name_from, '[EMAIL.FROM]' => $email_from);
if (Email::content(core::config('email.notify_email'), core::config('general.site_name'), $email_from, $name_from, 'contact-admin', $replace)) {
Alert::set(Alert::SUCCESS, __('Your message has been sent'));
} else {
Alert::set(Alert::ERROR, __('Message not sent'));
}
} else {
Alert::set(Alert::WARNING, __('This email has been considered as spam! We are sorry but we can not send this email.'));
}
} else {
Alert::set(Alert::ERROR, __('Wrong captcha'));
}
}
$this->template->content = View::factory('pages/contact');
}
示例2: gorusKaydet
function gorusKaydet()
{
captcha::check("index.php?option=com_yeterlilik_taslak&view=gorus_bildir&standartId=" . JRequest::getVar("standartId"));
$db =& JFactory::getOracleDBO();
$model = $this->getModel('gorus_kaydet');
$post = JRequest::get('post');
$message = $model->gorusKaydet($db, $post);
$this->setRedirect('index.php', $message);
}
示例3: ewiki_edit_save_antibot_checkbox
function ewiki_edit_save_antibot_checkbox(&$save, &$data)
{
global $ewiki_errmsg;
if (!$GLOBALS["ewiki_no_bot"]) {
include_once "plugins/lib/captcha.php";
if (!captcha::check()) {
$save = NULL;
$ewiki_errmsg = "Access Forbidden. You did not successfully pass the captcha.";
} else {
$GLOBALS["ewiki_no_bot"] = 1;
}
}
}
示例4: display
function display($tpl = null)
{
global $mainframe;
$redirect = "index.php?option=com_belge_sorgula&view=belge_sorgula";
$model =& $this->getModel();
$layout = JRequest::getVar("layout");
$kimlik_no = $_POST["kimlik_no"];
//SORGU SONUC
if (isset($layout) && $layout == "sorgu_sonuc") {
//Captcha
captcha::check($redirect);
//Kimlik No
if (!isset($_POST['kimlik_no']) || empty($_POST['kimlik_no'])) {
JError::raiseWarning(100, "Lütfen T.C. Kimlik No Giriniz");
$mainframe->redirect($redirect);
} else {
$data = $model->getBelgeDataByTcKimlikNo($kimlik_no);
$this->assignRef('data', $data);
}
}
parent::display($tpl);
}
示例5: action_userprofile_contact
public function action_userprofile_contact()
{
$user = new Model_User($this->request->param('id'));
//message to user
if ($user->loaded() and $this->request->post()) {
if (captcha::check('contact')) {
//akismet spam filter
if (!core::akismet(core::post('name'), core::post('email'), core::post('message'))) {
$ret = $user->email('userprofile.contact', array('[EMAIL.BODY]' => core::post('message'), '[EMAIL.SENDER]' => core::post('name'), '[EMAIL.SUBJECT]' => core::post('subject'), '[EMAIL.FROM]' => core::post('email')), core::post('email'), core::post('name'));
//if succesfully sent
if ($ret) {
Alert::set(Alert::SUCCESS, __('Your message has been sent'));
} else {
Alert::set(Alert::ERROR, __('Message not sent'));
}
} else {
Alert::set(Alert::SUCCESS, __('This email has been considered as spam! We are sorry but we can not send this email.'));
}
} else {
Alert::set(Alert::ERROR, __('You made some mistake'));
}
Request::current()->redirect(Route::url('profile', array('seoname' => $user->seoname)));
}
}
示例6: isset
$document =& JFactory::getDocument();
$document->addScript(SITE_URL . '/templates/elegance/js/paginate.min.js');
$document->addScript(SITE_URL . '/templates/elegance/js/tablesort.min.js');
?>
<div class="sinavGirisBaslik">Yeterlilik Taslakları</div>
<?php
$gorev = isset($_POST['gorev']) ? $_POST['gorev'] : "goster";
$itemId = JRequest::getVar('Itemid');
$itemId = isset($itemId) ? $itemId : JRequest::getVar('prevItemId');
$itemIdStr = isset($itemId) ? '&prevItemId=' . $itemId : '';
$itemIdStrOrj = isset($itemId) ? '&Itemid=' . $itemId : '';
if ($gorev == "goster") {
formGoster($itemIdStr);
} else {
if ($gorev == "hepsi") {
captcha::check("?option=com_yeterlilik_taslak_ara&gorev=goster&Itemid={$itemId}");
hepsiIleListele($itemIdStrOrj);
}
}
function formGoster($itemIdStr)
{
$db =& JFactory::getOracleDBO();
?>
<form action="?option=com_yeterlilik_taslak_ara<?php
echo $itemIdStr;
?>
" method="post">
<input type="hidden" value="hepsi" name="gorev" />
<table>
<tr>
<td width="200">Sektöre göre ara</td>
示例7: home
public function home()
{
global $core, $user;
$tree = $this->valid_tree();
$v = $this->__(_array_keys(w('is_comment is_form'), 0));
// Form posting enabled and form submitted
if ($v['is_form'] && _button()) {
if (!is_ghost()) {
_fatal(405);
}
if (!$tree['tree_form']) {
_fatal();
}
$sql_fields = 'SELECT form_alias, form_required, form_legend, form_regex,
FROM _form_fields
WHERE form_tree = ?
ORDER BY form_order';
if (!($form = _rowset(sql_filter($sql_fields, $tree['tree_id']), 'form_alias'))) {
$form = _rowset(sql_filter($sql_fields, 0), 'form_alias');
}
$form['secure'] = array('form_required' => 1, 'form_regex' => '^([a-zA-Z]+)$', 'form_alias' => 'secure', 'form_type' => 'text', 'form_legend' => _lang('XCF_LEGEND'));
foreach ($form as $row) {
$v = array_merge($v, $this->__(array($row['form_alias'])));
if (!f($v[$row['form_alias']])) {
if ($row['form_required']) {
$this->_error(sprintf(_lang('E_COMMENT_FIELD_EMPTY'), $row['form_legend']), false);
}
continue;
}
if (f($row['form_regex']) && !preg_match('#' . $row['form_regex'] . '#is', $v[$row['form_alias']])) {
$this->_error(sprintf(_lang('E_COMMENT_FIELD_BAD'), $row['form_legend']), false);
if ($row['form_alias'] == 'secure') {
$v[$row['form_alias']] = '';
}
}
}
require_once XFS . 'core/xcf.php';
$xcf = new captcha();
if ($xcf->check($v['secure']) === false) {
$v['secure'] = '';
$this->_error('#E_COMMENT_INVALID_CAPTCHA');
}
unset($xcf);
require_once XFS . 'core/emailer.php';
$emailer = new emailer();
$emailer->set_decode(true);
$emailer->format('plain');
$emailer->from($v['address']);
$emailer->set_subject(_rm_acute($v['subject']));
$emailer->use_template('contact_email');
if (f($core->v('default_email'))) {
$tree['tree_form_email'] .= (f($tree['tree_form_email']) ? ';' : '') . $core->v('default_email');
}
$form_addresses = array_map('trim', array_unique(explode(';', $tree['tree_form_email'])));
foreach ($form_addresses as $i => $address) {
$row_f = !$i ? 'email_address' : 'cc';
$emailer->{$row_f}($address);
}
unset($v['secure']);
$content = w();
foreach ($form as $row) {
if (!f($v[$row['form_alias']])) {
continue;
}
$content[] = $row['form_legend'] . ":\n" . $v[$row['form_alias']];
}
$emailer->assign_vars(array('CONTENT' => implode("\n\n", $content), 'FORM_ARTICLE' => $tree['tree_subject']));
$emailer->send();
$emailer->reset();
$response = array('lang' => _lang('FORM_SUCCESS'));
$this->e(json_encode($response));
}
// Comment posting enabled and form submitted.
if ($v['is_comment'] && _button()) {
if (!$tree['tree_allow_comments']) {
_fatal();
}
$cv = $this->__(w('comment_username comment_address comment_website comment_message comment_security'));
$comment_time = time();
if (!$user->v('is_member')) {
foreach ($cv as $cv_k => $cv_v) {
if (!f($cv_v)) {
$this->error('E_COMMENT_FILL_FIELDS');
break;
}
}
if (!$this->errors()) {
$sql = 'SELECT comment_time
FROM _comments
WHERE comment_ip = ?
AND comment_status = 0';
if ($row_flood = _fieldrow(sql_filter($sql, $user->ip))) {
if ($comment_time - $row_flood['comment_time'] < 30) {
$this->error('E_COMMENT_FLOOD_TIME');
}
}
}
// CAPTCHA verification
require_once XFS . 'core/xcf.php';
$xcf = new captcha();
//.........这里部分代码省略.........
示例8: action_reviews
/**
*
* Display reviews advert.
* @throws HTTP_Exception_404
*
*/
public function action_reviews()
{
$seotitle = $this->request->param('seotitle', NULL);
if ($seotitle !== NULL and Core::config('advertisement.reviews') == 1) {
$ad = new Model_Ad();
$ad->where('seotitle', '=', $seotitle)->where('status', '!=', Model_Ad::STATUS_SPAM)->limit(1)->cached()->find();
if ($ad->loaded()) {
$errors = NULL;
//adding a new review
if ($this->request->post() and Auth::instance()->logged_in()) {
$user = Auth::instance()->get_user();
//only able to review if bought the product
if (Core::config('advertisement.reviews_paid') == 1) {
$order = new Model_Order();
$order->where('id_ad', '=', $ad->id_ad)->where('id_user', '=', $user->id_user)->where('id_product', '=', Model_Order::PRODUCT_AD_SELL)->where('status', '=', Model_Order::STATUS_PAID)->find();
if (!$order->loaded()) {
Alert::set(Alert::ERROR, __('You can only add a review if you bought this product'));
$this->redirect(Route::url('ad-review', array('seotitle' => $ad->seotitle)));
}
}
//not allowing to review to yourself
if ($user->id_user == $ad->id_user) {
Alert::set(Alert::ERROR, __('You can not review yourself.'));
$this->redirect(Route::url('ad-review', array('seotitle' => $ad->seotitle)));
}
$review = new Model_Review();
$review->where('id_ad', '=', $ad->id_ad)->where_open()->or_where('id_user', '=', $user->id_user)->or_where('ip_address', '=', ip2long(Request::$client_ip))->where_close()->find();
//d($review);
if (!$review->loaded()) {
if (captcha::check('review')) {
$validation = Validation::factory($this->request->post())->rule('rate', 'numeric')->rule('description', 'not_empty')->rule('description', 'min_length', array(':value', 5))->rule('description', 'max_length', array(':value', 1000));
if ($validation->check()) {
$rate = core::post('rate');
if ($rate > Model_Review::RATE_MAX) {
$rate = Model_Review::RATE_MAX;
} elseif ($rate < 0) {
$rate = 0;
}
$review = new Model_Review();
$review->id_user = $user->id_user;
$review->id_ad = $ad->id_ad;
$review->description = core::post('description');
$review->status = Model_Review::STATUS_ACTIVE;
$review->ip_address = ip2long(Request::$client_ip);
$review->rate = $rate;
$review->save();
//email product owner?? notify him of new review
$ad->user->email('ad-review', array('[AD.TITLE]' => $ad->title, '[RATE]' => $review->rate, '[DESCRIPTION]' => $review->description, '[URL.QL]' => $ad->user->ql('ad-review', array('seotitle' => $ad->seotitle))));
$ad->recalculate_rate();
$ad->user->recalculate_rate();
Alert::set(Alert::SUCCESS, __('Thanks for your review!'));
} else {
$errors = $validation->errors('ad');
foreach ($errors as $f => $err) {
Alert::set(Alert::ALERT, $err);
}
}
} else {
Alert::set(Alert::ERROR, __('Wrong Captcha'));
}
} else {
Alert::set(Alert::ERROR, __('You already added a review'));
}
}
$this->template->scripts['footer'][] = 'js/jquery.raty.min.js';
$this->template->scripts['footer'][] = 'js/review.js';
Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Home'))->set_url(Route::url('default')));
Breadcrumbs::add(Breadcrumb::factory()->set_title($ad->title)->set_url(Route::url('ad', array('seotitle' => $ad->seotitle, 'category' => $ad->category->seoname))));
$this->template->title = $ad->title . ' - ' . __('Reviews');
Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Reviews')));
$this->template->meta_description = text::removebbcode($ad->description);
$permission = TRUE;
//permission to add hit to advert and give access rights.
$auth_user = Auth::instance();
if (!$auth_user->logged_in() or $auth_user->get_user()->id_user != $ad->id_user and ($auth_user->get_user()->id_role != Model_Role::ROLE_ADMIN and $auth_user->get_user()->id_role != Model_Role::ROLE_MODERATOR) or $auth_user->get_user()->id_role != Model_Role::ROLE_ADMIN and $auth_user->get_user()->id_role != Model_Role::ROLE_MODERATOR) {
$permission = FALSE;
$user = NULL;
} else {
$user = $auth_user->get_user()->id_user;
}
$captcha_show = core::config('advertisement.captcha');
if ($ad->get_first_image() !== NULL) {
Controller::$image = $ad->get_first_image();
}
$reviews = new Model_Review();
$reviews = $reviews->where('id_ad', '=', $ad->id_ad)->where('status', '=', Model_Review::STATUS_ACTIVE)->find_all();
$this->template->bind('content', $content);
$this->template->content = View::factory('pages/ad/reviews', array('ad' => $ad, 'permission' => $permission, 'captcha_show' => $captcha_show, 'user' => $user, 'reviews' => $reviews, 'errors' => $errors));
} else {
//throw 404
throw HTTP_Exception::factory(404, __('Page not found'));
}
} else {
//throw 404
//.........这里部分代码省略.........
示例9: action_register
/**
* Simple register for user
*
*/
public function action_register()
{
//validates captcha
if (Core::post('ajaxValidateCaptcha')) {
$this->auto_render = FALSE;
$this->template = View::factory('js');
if (captcha::check('register', TRUE)) {
$this->template->content = 'true';
} else {
$this->template->content = 'false';
}
return;
}
$this->template->meta_description = __('Create a new profile at') . ' ' . core::config('general.site_name');
$this->template->content = View::factory('pages/auth/register');
$this->template->content->msg = '';
//if user loged in redirect home
if (Auth::instance()->logged_in()) {
$this->redirect(Route::get('oc-panel')->uri());
} elseif ($this->request->post()) {
if (captcha::check('register')) {
$validation = Validation::factory($this->request->post())->rule('name', 'not_empty')->rule('email', 'not_empty')->rule('email', 'email')->rule('email', 'email_domain')->rule('password1', 'not_empty')->rule('password2', 'not_empty')->rule('password1', 'matches', array(':validation', 'password1', 'password2'));
if (core::post('cf_vatnumber') and core::post('cf_vatcountry')) {
if (!euvat::verify_vies(core::post('cf_vatnumber'), core::post('cf_vatcountry'))) {
Alert::set(Alert::ERROR, __('Invalid EU Vat Number, please verify number and country match'));
$this->redirect(Route::url('oc-panel', array('controller' => 'auth', 'action' => 'register')));
}
}
if ($validation->check()) {
//posting data so try to remember password
if (CSRF::valid('register')) {
$email = core::post('email');
//check we have this email in the DB
$user = new Model_User();
$user = $user->where('email', '=', $email)->limit(1)->find();
if ($user->loaded()) {
Form::set_errors(array(__('User already exists')));
} else {
//creating the user
$user = Model_User::create_email($email, core::post('name'), core::post('password1'));
//add custom fields
$save_cf = FALSE;
foreach ($this->request->post() as $custom_field => $value) {
if (strpos($custom_field, 'cf_') !== FALSE) {
$user->{$custom_field} = $value;
$save_cf = TRUE;
}
}
//saves the user only if there was CF
if ($save_cf === TRUE) {
$user->save();
}
//login the user
Auth::instance()->login(core::post('email'), core::post('password1'));
Alert::set(Alert::SUCCESS, __('Welcome!'));
//login the user
$this->redirect(Core::post('auth_redirect', Route::url('oc-panel')));
}
}
} else {
$errors = $validation->errors('auth');
foreach ($errors as $error) {
Alert::set(Alert::ALERT, $error);
}
}
} else {
Alert::set(Alert::ALERT, __('Captcha is not correct'));
}
}
//template header
$this->template->title = __('Register new user');
}
示例10: check
function check($form)
{
global $_out;
$xml = new xml($form);
$res = $xml->query('.//field[@check]', $form);
$arrEmptyOrFlags = array();
foreach ($res as $field) {
$val = param($field->getAttribute('name'));
if (preg_match('/empty-or-([^\\s"]+)/', $field->getAttribute('check'), $m) && ($field2 = $xml->query('.//field[@name="' . $m[1] . '"]', $form)->item(0))) {
if (!in_array($m[1], $arrEmptyOrFlags)) {
$arrEmptyOrFlags[] = $field->getAttribute('name');
if ($this->validateFieldValue($form, $field, $val) && $this->validateFieldValue($form, $field2, param($m[1]))) {
$this->err('Field "' . $field->getAttribute('label') . '" or "' . $field2->getAttribute('label') . '" required');
}
}
continue;
}
if ($err = $this->validateFieldValue($form, $field, $val)) {
$this->err($err);
}
}
if ($this->hasCaptcha($form)) {
$captcha = new captcha();
$captcha->setLanguage($_out->getLang());
$captcha->setParamName('captcha');
if (!$captcha->check()) {
$this->err('The result of the expression in the image incorrectly');
}
}
return $this->hasErrors();
}
示例11: addcom
function addcom()
{
global $db, $apx, $user;
$_POST['mid'] = (int) $_POST['mid'];
if (!$_POST['mid']) {
die('missing mID!');
}
//if ( !$apx->is_module($_POST['module']) ) die('invalid MODULE!');
$apx->lang->drop('add', 'comments');
list($spam) = $db->first("SELECT time FROM " . PRE . "_comments WHERE ( module='" . addslashes($_POST['module']) . "' AND ip='" . get_remoteaddr() . "' AND mid='" . $_POST['mid'] . "' ) ORDER BY time DESC");
//Captcha prüfen
if ($this->set['captcha'] && !$user->info['userid']) {
require BASEDIR . 'lib/class.captcha.php';
$captcha = new captcha();
$captchafailed = $captcha->check();
}
if ($user->info['userid']) {
if ($captchafailed) {
message($apx->lang->get('MSG_COM_WRONGCODE'), 'javascript:history.back()');
} elseif ($this->ip_is_blocked()) {
message($apx->lang->get('MSG_COM_BLOCKIP'), 'back');
} elseif (!$_POST['text'] || $this->set['req_title'] && !$_POST['title']) {
message('back');
} elseif ($this->text_is_blocked()) {
message($apx->lang->get('MSG_COM_BLOCKTEXT'), 'back');
} elseif ($this->set['maxlen'] && strlen($_POST['text']) > $this->set['maxlen']) {
message($apx->lang->get('MSG_COM_TOOLONG'), 'back');
} elseif ($spam + $this->set['spamprot'] * 60 > time()) {
message($apx->lang->get('MSG_COM_BLOCKSPAM', array('SEC' => $spam + $this->set['spamprot'] * 60 - time())), 'back');
} else {
if ($this->set['mod'] && !$user->is_team_member()) {
$_POST['active'] = 0;
} else {
$_POST['active'] = 1;
}
$_POST['userid'] = $user->info['userid'];
$_POST['username'] = $user->info['username'];
$_POST['time'] = time();
$_POST['ip'] = get_remoteaddr();
$db->dinsert(PRE . '_comments', 'module,mid,userid,username,title,text,time,notify,ip,active');
$comid = $db->insert_id();
//eMail-Benachrichtigung (Admin)
if ($this->set['mailonnew']) {
$text = strip_tags(dbcodes($_POST['text']));
$input = array('URL' => HTTP, 'GOTO' => HTTP_HOST . $_SERVER['REQUEST_URI'], 'TEXT' => $text);
sendmail($this->set['mailonnew'], 'SENDCOM', $input);
}
//eMail-Benachrichtigung (User)
if ($_POST['active']) {
$data = $db->fetch("\n\t\t\t\t\t\tSELECT DISTINCT IF(c.userid, u.email, c.email) AS email\n\t\t\t\t\t\tFROM " . PRE . "_comments AS c\n\t\t\t\t\t\tLEFT JOIN " . PRE . "_user AS u USING(userid)\n\t\t\t\t\t\tWHERE c.module='" . addslashes($_POST['module']) . "' AND c.mid='" . addslashes($_POST['mid']) . "' AND c.notify=1 AND c.id!='" . $comid . "' AND c.userid!=" . $user->info['userid'] . "\n\t\t\t\t\t");
if (count($data)) {
foreach ($data as $res) {
$input = array('URL' => HTTP, 'GOTO' => HTTP_HOST . $_SERVER['REQUEST_URI']);
sendmail($res['email'], 'NOTIFYCOM', $input);
}
}
//Notify zurücksetzen
$db->query("UPDATE " . PRE . "_comments SET notify=0 WHERE module='" . addslashes($_POST['module']) . "' AND mid='" . addslashes($_POST['mid']) . "' AND id!='" . $comid . "'");
}
//Captcha löschen
if ($this->set['captcha'] && !$user->info['userid']) {
$captcha->remove();
}
message($apx->lang->get('MSG_COM_OK'), str_replace('&', '&', $_SERVER['REQUEST_URI']));
}
} elseif ($this->set['pub']) {
if (!checkmail($_POST['email'])) {
if ($this->set['req_email']) {
$emailnotvalid = true;
} else {
$_POST['email'] = '';
}
}
if ($captchafailed) {
message($apx->lang->get('MSG_COM_WRONGCODE'), 'javascript:history.back()');
} elseif ($this->ip_is_blocked()) {
message($apx->lang->get('MSG_COM_BLOCKIP'), 'back');
} elseif (!$_POST['username'] || !$_POST['text'] || $this->set['req_email'] && !$_POST['email'] || $this->set['req_homepage'] && !$_POST['homepage'] || $this->set['req_title'] && !$_POST['title']) {
message('back');
} elseif ($_POST['notify'] && !$_POST['email']) {
message($apx->lang->get('MSG_COM_MAILNEEDED'), 'back');
} elseif ($this->text_is_blocked()) {
message($apx->lang->get('MSG_COM_BLOCKTEXT'), 'back');
} elseif ($this->set['entrymaxlen'] && strlen($_POST['text']) > $this->set['entrymaxlen']) {
message($apx->lang->get('MSG_COM_TOOLONG'), 'back');
} elseif ($emailnotvalid) {
message($apx->lang->get('MSG_COM_EMAILNOTVALID'), 'back');
} elseif ($spam + $this->set['spamprot'] * 60 > time()) {
message($apx->lang->get('MSG_COM_BLOCKSPAM', array('SEC' => $spam + $this->set['spamprot'] * 60 - time())), 'back');
} else {
if (substr($_POST['homepage'], 0, 4) == 'www.') {
$_POST['homepage'] = 'http://' . $_POST['homepage'];
}
if ($this->set['mod']) {
$_POST['active'] = 0;
} else {
$_POST['active'] = 1;
}
$_POST['time'] = time();
$_POST['ip'] = get_remoteaddr();
//.........这里部分代码省略.........
示例12: isset
$document =& JFactory::getDocument();
$document->addScript(SITE_URL . '/templates/elegance/js/paginate.min.js');
$document->addScript(SITE_URL . '/templates/elegance/js/tablesort.min.js');
$gorev = JRequest::getVar('gorev');
$itemId = JRequest::getVar('Itemid');
$itemId = isset($itemId) ? $itemId : JRequest::getVar('prevItemId');
$itemIdStr = isset($itemId) ? '&prevItemId=' . $itemId : '';
$itemIdStrOrj = isset($itemId) ? '&Itemid=' . $itemId : '';
?>
<div class="sinavGirisBaslik">Yetkilendirilmiş Kuruluşlar</div>
<?php
if ($gorev == "goster" || $gorev == '') {
formGoster($itemIdStr);
} else {
if ($gorev == "hepsi") {
captcha::check("index.php?option=com_yetkilendirilmis_kurulus_ara&gorev=goster&Itemid={$itemId}");
hepsiIleListele($itemIdStrOrj);
} else {
if ($gorev == "tumu") {
tumunuListele($itemIdStrOrj);
} else {
if ($gorev == "ayrinti") {
kurulusBilgiListele($itemIdStrOrj);
}
}
}
}
function formGoster($itemIdStr)
{
$db =& JFactory::getOracleDBO();
?>
示例13: action_register
/**
* Simple register for user
*
*/
public function action_register()
{
//validates captcha
if (Core::post('ajaxValidateCaptcha')) {
$this->auto_render = FALSE;
$this->template = View::factory('js');
if (captcha::check('register', TRUE)) {
$this->template->content = 'true';
} else {
$this->template->content = 'false';
}
return;
}
$this->template->content = View::factory('pages/auth/register');
$this->template->content->msg = '';
//if user loged in redirect home
if (Auth::instance()->logged_in()) {
$this->redirect(Route::get('oc-panel')->uri());
} elseif ($this->request->post()) {
if (captcha::check('register')) {
$validation = Validation::factory($this->request->post())->rule('name', 'not_empty')->rule('email', 'not_empty')->rule('email', 'email')->rule('password1', 'not_empty')->rule('password2', 'not_empty')->rule('password1', 'matches', array(':validation', 'password1', 'password2'));
if ($validation->check()) {
//posting data so try to remember password
if (CSRF::valid('register')) {
$email = core::post('email');
//check we have this email in the DB
$user = new Model_User();
$user = $user->where('email', '=', $email)->limit(1)->find();
if ($user->loaded()) {
Form::set_errors(array(__('User already exists')));
} else {
//creating the user
$user = Model_User::create_email($email, core::post('name'), core::post('password1'));
//login the user
Auth::instance()->login(core::post('email'), core::post('password1'));
Alert::set(Alert::SUCCESS, __('Welcome!'));
//login the user
$this->redirect(Core::post('auth_redirect', Route::url('oc-panel')));
}
}
} else {
$errors = $validation->errors('auth');
foreach ($errors as $error) {
Alert::set(Alert::ALERT, $error);
}
}
} else {
Alert::set(Alert::ALERT, __('Captcha is not correct'));
}
}
//template header
$this->template->title = __('Register new user');
$this->template->meta_description = __('Create a new profile at') . ' ' . Core::config('general.site_name');
}
示例14: isset
?>
<div class="sinavGirisBaslik"><?php
echo $baslik;
?>
</div>
<?php
$gorev = isset($_POST['gorev']) ? $_POST['gorev'] : "goster";
$itemId = JRequest::getVar('Itemid');
$itemId = isset($itemId) ? $itemId : JRequest::getVar('prevItemId');
$itemIdStr = isset($itemId) ? '&prevItemId=' . $itemId : '';
$itemIdStrOrj = isset($itemId) ? '&Itemid=' . $itemId : '';
if ($gorev == "goster") {
formGoster($itemIdStr, $protokolStr, $gorusStr);
} else {
if ($gorev == "hepsi") {
captcha::check("index.php?option=com_meslek_std_taslak_ara&gorev=goster{$protokolStr}&Itemid={$itemId}");
hepsiIleListele($itemIdStrOrj, $isProtokol, $protokolStr, $isGorus, $gorusStr);
}
}
function formGoster($itemIdStr, $protokolStr, $gorusStr)
{
$db =& JFactory::getOracleDBO();
?>
<form
action="index.php?option=com_meslek_std_taslak_ara<?php
echo $protokolStr;
echo $gorusStr;
echo $itemIdStr;
?>
"
method="post"><input type="hidden" value="hepsi" name="gorev" />
示例15: isset
?>
<div class="sinavGirisBaslik"><?php
echo $baslik;
?>
</div>
<?php
$gorev = isset($_POST['gorev']) ? $_POST['gorev'] : "goster";
$itemId = JRequest::getVar('Itemid');
$itemId = isset($itemId) ? $itemId : JRequest::getVar('prevItemId');
$itemIdStr = isset($itemId) ? '&prevItemId=' . $itemId : '';
$itemIdStrOrj = isset($itemId) ? '&Itemid=' . $itemId : '';
if ($gorev == "goster") {
formGoster($itemIdStr, $protokolStr, $gorusStr);
} else {
if ($gorev == "hepsi") {
captcha::check("index.php?option=com_yeterlilik_taslak_ara&gorev=goster{$protokolStr}&Itemid={$itemId}");
hepsiIleListele($itemIdStrOrj, $isProtokol, $protokolStr, $isGorus, $gorusStr);
}
}
function formGoster($itemIdStr, $protokolStr, $gorusStr)
{
$db =& JFactory::getOracleDBO();
?>
<form action="index.php?option=com_yeterlilik_taslak_ara<?php
echo $protokolStr;
echo $gorusStr;
echo $itemIdStr;
?>
" method="post">
<input type="hidden" value="hepsi" name="gorev" />
<table>