public function pre_sub_proc($request, $params) { $form_name = 'form_' . $this->form_id . "_" . $this->form_number; if (!is_user_logged_in()) { $prime_data = $this->get_prepared_data_primary($request); if (!isset($prime_data['user_email'], $prime_data['username'])) { return false; } $email = $prime_data['user_email']->value; $username = $prime_data['username']->value; if (isset($prime_data['password'])) { $password = $prime_data['password']->value; $password_conf = $prime_data['password_confirmation']->value; if ($password !== $password_conf) { Form::setError($form_name, RM_UI_Strings::get("ERR_PW_MISMATCH")); return false; } } $user = get_user_by('login', $username); if (!empty($user)) { $this->user_exists = true; Form::setError($form_name, RM_UI_Strings::get("USERNAME_EXISTS")); return false; } $user = get_user_by('email', $email); if (!empty($user)) { $this->user_exists = true; Form::setError($form_name, RM_UI_Strings::get("USERNAME_EXISTS")); return false; } Form::clearErrors($form_name); return true; } return true; }
public function form($model, $service, $request, $params) { if (isset($request->req['rm_target'])) { if ($request->req['rm_target'] == 'fbcb') { $service->facebook_login_callback(); } } if ($this->mv_handler->validateForm("rm_login_form")) { $user = $service->login($request); if (is_wp_error($user)) { Form::setError('rm_login_form', $user->get_error_message()); } else { $redirect_to = RM_Utilities::after_login_redirect($user); RM_Utilities::redirect($redirect_to); die; } } $data = new stdClass(); //$service->facebook_login_callback(); $data->facebook_html = $service->facebook_login_html(); $view = $this->mv_handler->setView('login', true); return $view->read($data); }
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require '../../core.php'; $session->loginRequired('admin', false); $Form = new Form(); if (!isset($_GET['id'])) { $Form->setError('error', 'No User ID Found!'); $Form->return_msg_to('administrator.php'); } $id = cleanData($_GET['id']); $data = mysql_fetch_object(mysql_query('SELECT * FROM user WHERE id="' . $id . '" AND type="admin"')); if ($data === FALSE) { $Form->setError('error', 'No User ID Found!'); $Form->return_msg_to('administrator.php'); } $receive_email = $_GET['receive_email']; $result = mysql_query('UPDATE `user` SET `receive_email`="' . $receive_email . '" WHERE id="' . $id . '" AND type="admin"'); echo $result;
/** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ include '../../core.php'; $session->loginRequired('admin', false); $form = new Form(); if (isset($_POST['add_agency']) && $_POST['add_agency'] == 'ADD') { $name = cleanData($_POST['name']); $contact = cleanData($_POST['contact']); $email = cleanData($_POST['email']); $phone = cleanData($_POST['phone']); if ($name == '') { $form->setError('agency_error', 'Agency Name is required!'); $form->return_msg_to(WEBSITE_URL . 'admin/user/add-an-agency.php'); } if ($contact == '') { $form->setError('agency_error', 'Primary Contact is required!'); $form->return_msg_to(WEBSITE_URL . 'admin/user/add-an-agency.php'); } if ($email == '' || !is_valid_email($email)) { $form->setError('agency_error', 'Agency Email is required and must be valid!'); $form->return_msg_to(WEBSITE_URL . 'admin/user/add-an-agency.php'); } if ($phone == '') { $form->setError('agency_error', 'Phone is required!'); $form->return_msg_to(WEBSITE_URL . 'admin/user/add-an-agency.php'); } $status = mysql_query("INSERT INTO agency (`agency_name`, `primary_contact`, `email`, `phone_no`, `create_date`) VALUES ('{$name}', '{$contact}', '{$email}', '{$phone}', NOW())");
/** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require 'core.php'; $session->loginRequired('user', false); $Form = new Form(); $Email = new Email(); if (!isset($_POST['submit'])) { redirect('view.php'); } else { if (!isset($_POST['first_name']) || empty($_POST['first_name'])) { $Form->setError('error', 'Please write your first name.'); } if (!isset($_POST['last_name']) || empty($_POST['last_name'])) { $Form->setError('error', 'Please write your last name.'); } if (!isset($_POST['lead_result']) || empty($_POST['lead_result'])) { $Form->setError('error', 'Please select a lead result.'); } if ($_POST['lead_result'] == 'Y') { if (!isset($_POST['call_time']) || empty($_POST['call_time'])) { $Form->setError('leadsError', 'Please select call time and enter a phone number'); } if (!isset($_POST['phone_no']) || empty($_POST['phone_no'])) { $Form->setError('leadsError', 'Please select call time and enter a phone number'); } }
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require '../../core.php'; $session->loginRequired('admin', false); $Form = new Form(); // First Name if (!isset($_POST['first_name']) || empty($_POST['first_name'])) { $Form->setError('error', 'Please write user First Name'); } // Last Name if (!isset($_POST['last_name']) || empty($_POST['last_name'])) { $Form->setError('error', 'Please write user Last Name'); } // Email if (!isset($_POST['email']) || empty($_POST['email'])) { $Form->setError('error', 'Please write user Email address'); } elseif (!is_valid_email($_POST['email'])) { $Form->setError('error', 'Please write a valid Email address'); } else { $user_check_query = mysql_query('SELECT * FROM ' . TBL_USER . ' WHERE email="' . cleanData($_POST['email']) . '"'); if (mysql_num_rows($user_check_query) > 0) { $Form->setError('error', 'User with ' . $_POST['email'] . ' is already exist!'); } } // Password
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require '../../core.php'; $session->loginRequired('admin', false); $Form = new Form(); if (!isset($_POST['id'])) { $Form->setError('error', 'Please select a admin!'); $Form->return_msg_to('administrator.php'); } if (isset($_POST['delete_admin']) && $_POST['delete_admin'] == 'DELETE') { $id = $_POST['id']; if (sizeof($id) <= 0) { $Form->setError('error', 'Please select an admin to delete!'); $Form->return_msg_to('administrator.php'); } foreach ($id as $id) { mysql_query("DELETE FROM " . TBL_USER . " WHERE `id`={$id}"); } $Form->setError('success', 'Admin(s) deleted successfully!'); $Form->return_msg_to('administrator.php'); } else { if (isset($_POST['edit_admin']) && $_POST['edit_admin'] == 'EDIT') { $id = $_POST['id']; if (sizeof($id) <= 0) { $Form->setError('error', 'Please select an admin to edit!');
public function should_reset_password($request) { if (isset($request['old_pass'], $request['new_pass'], $request['new_pass_repeat'])) { $user = wp_get_current_user(); if ($user instanceof WP_User && wp_check_password($request['old_pass'], $user->data->user_pass, $user->ID)) { if ($request['new_pass'] === $request['new_pass_repeat']) { return true; } else { Form::setError('rm_reset_pass_form', RM_UI_Strings::get('ERR_PASS_DOES_NOT_MATCH')); } } else { Form::setError('rm_reset_pass_form', RM_UI_Strings::get('ERR_WRONG_PASS')); } } return false; }
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ include '../../core.php'; $session->loginRequired('admin', false); $form = new Form(); if (isset($_POST['submit_starter']) && $_POST['submit_starter'] == 'ADD') { if (!isset($_POST['starter'])) { $form->setError('starter_error', 'Please select a starter!'); $form->return_msg_to(WEBSITE_URL . 'admin/starter/add-starter.php'); } $starter = cleanData($_POST['starter']); if ($starter != '') { $status = mysql_query("INSERT INTO starter (`starter`, `create_date`) VALUES ('{$starter}', NOW())"); if ($status) { $form->setError('starter_success', 'Conversation added successfully!'); $form->return_msg_to(WEBSITE_URL . 'admin/starter/add-starter.php'); } } else { $form->setError('starter_error', 'Please enter some value!'); $form->return_msg_to(WEBSITE_URL . 'admin/starter/add-starter.php'); } } else { $form->return_msg_to(WEBSITE_URL . 'admin/starter/add-starter.php'); }
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require 'core.php'; $Form = new Form(); $Email = new Email(); if (!isset($_POST['submit'])) { redirect('forgot_password.php'); } else { if (!isset($_POST['email']) || empty($_POST['email'])) { $Form->setError('email', 'Please write your email address'); } if ($Form->num_errors > 0) { $Form->return_msg_to('forgot_password.php'); } else { $email = cleanData($_POST['email']); $user = mysql_fetch_assoc(mysql_query('SELECT * FROM ' . TBL_USER . ' WHERE email="' . $email . '"')); if (!$user) { $Form->setError('notFound', 'User Not Found.'); $Form->return_msg_to('forgot_password.php'); } else { $Email->setEmailSubject('Forgot Password'); $Email->setMessage('Your password is ' . $user['password']); $Email->setEmailTo($email); if ($Email->sendMail()) { $Form->setError('success', 'Your password has been sent to your email. Please check your mails.');
function set_error($error) { if (isset($error) && !empty($error)) { foreach ($error->errors as $error) { Form::setError($this->formId, $error[0]); } } }
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require '../../core.php'; $session->loginRequired('admin', false); $Form = new Form(); if (!isset($_POST['users'])) { $Form->setError('error', 'Please select a user!'); $Form->return_msg_to('user.php'); } if (isset($_POST['delete_user'])) { $users = $_POST['users']; if (sizeof($users) <= 0) { $Form->setError('error', 'Please select a user to delete!'); $Form->return_msg_to('user.php'); } foreach ($users as $user_id) { mysql_query("DELETE FROM " . TBL_USER . " WHERE `id`={$user_id}"); } $Form->setError('success', 'User(s) deleted successfully!'); $Form->return_msg_to('user.php'); } elseif (isset($_POST['edit_user'])) { $users = $_POST['users']; if (sizeof($users) <= 0) { $Form->setError('error', 'Please select a user to Edit!'); $Form->return_msg_to('user.php');
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require '../../core.php'; $session->loginRequired('admin', false); $Form = new Form(); //User ID if (!isset($_POST['id']) || empty($_POST['id'])) { $Form->setError('error', 'No Admin ID Found!'); $Form->return_msg_to('administrator.php'); } else { $user_query = mysql_query("SELECT * FROM " . TBL_USER . " WHERE id='" . cleanData($_POST['id']) . "'"); if (mysql_num_rows($user_query) < 1) { $Form->setError('error', 'No admin found!'); $Form->return_msg_to('administrator.php'); } } // First Name if (!isset($_POST['first_name']) || empty($_POST['first_name'])) { $Form->setError('error', 'Please write user First Name'); } // Last Name if (!isset($_POST['last_name']) || empty($_POST['last_name'])) { $Form->setError('error', 'Please write user Last Name'); } // Email
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require '../../core.php'; $session->loginRequired('admin', false); $Form = new Form(); if (!isset($_POST['submit'])) { redirect('view.php'); } else { if (!isset($_POST['description']) || empty($_POST['description'])) { $Form->setError('error', 'Fill The form perfectly.'); } if (!isset($_FILES['file']) || empty($_FILES['file'])) { $Form->setError('error', 'Fill The form perfectly.'); } else { $Upload = new upload($_FILES['file']); if ($Upload->extension != "jpg" && $Upload->extension != "jpeg" && $Upload->extension != "png" && $Upload->extension != "jpg") { $Form->setError('extension', 'Only images can be uploaded.'); } } if ($Form->num_errors > 0) { $Form->return_msg_to('add-banner.php'); } else { // save Image $Upload->save_file(); $file_name = $Upload->basename;
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require '../../core.php'; $session->loginRequired('admin', false); $Form = new Form(); if (!isset($_POST['agency_id'])) { $Form->setError('error', 'Please select a agency!'); $Form->return_msg_to('user.php'); } if (isset($_POST['delete_agency'])) { $agency_id = $_POST['agency_id']; if (sizeof($agency_id) <= 0) { $Form->setError('error', 'Please select an agency to delete!'); $Form->return_msg_to('user.php'); } foreach ($agency_id as $id) { mysql_query("DELETE FROM " . TBL_AGENCY . " WHERE `id`={$id}"); } $Form->setError('success', 'Agency(s) deleted successfully!'); $Form->return_msg_to('user.php'); } else { if (isset($_POST['edit_agency'])) { $agency_id = $_POST['agency_id']; if (sizeof($agency_id) <= 0) { $Form->setError('error', 'Please select an agency to edit!');
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ include '../../core.php'; $session->loginRequired('admin', false); $form = new Form(); if (!isset($_POST['starter_id'])) { $form->setError('starter_error', 'Please select a starter!'); $form->return_msg_to('starters.php'); } if (isset($_POST['delete_starter']) && $_POST['delete_starter'] == 'DELETE') { $starter_id = $_POST['starter_id']; if (sizeof($starter_id) <= 0) { $form->setError('starter_error', 'Please select a conversation to delete!'); $form->return_msg_to('starters.php'); } foreach ($starter_id as $id) { mysql_query("DELETE FROM starter WHERE `id`={$id}"); } $form->setError('starter_success', 'Conversation(s) deleted successfully!'); $form->return_msg_to('starters.php'); } else { if (isset($_POST['edit_starter']) && $_POST['edit_starter'] == 'EDIT') { $starter_id = $_POST['starter_id']; if (sizeof($starter_id) <= 0) { $form->setError('starter_error', 'Please select a conversation to edit!');
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require 'core.php'; $Form = new Form(); if (!isset($_POST['submit'])) { redirect('login.php'); } else { if (!isset($_POST['email']) || empty($_POST['email'])) { $Form->setError('error', 'Your email or password is incorrect.'); } if (!isset($_POST['password']) || empty($_POST['password'])) { $Form->setError('error', 'Your email or password is incorrect.'); } if ($Form->num_errors > 0) { $Form->return_msg_to('login.php'); } else { $email = cleanData($_POST['email']); $password = cleanData($_POST['password']); $remember_me = isset($_POST['remember_me']) ? true : false; $login = $session->login($email, $password, $remember_me); if ($login) { if ($_SESSION['loginType'] == 'admin') { redirect(WEBSITE_URL . 'admin/dashboard.php'); } else { redirect('view.php');
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ include '../../core.php'; $session->loginRequired('admin'); $Form = new Form(); if (!isset($_GET['id']) || empty($_GET['id'])) { $Form->setError('error', 'No agency ID found!'); $Form->return_msg_to('user.php'); } $id = cleanData($_GET['id']); $agency_query = mysql_query("SELECT * FROM " . TBL_AGENCY . " WHERE id = '" . $id . "' LIMIT 1"); if (mysql_num_rows($agency_query) < 1) { $Form->setError('error', 'No agency found with given ID!'); $Form->return_msg_to('user.php'); } $agency_data = mysql_fetch_assoc($agency_query); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Life Department - Edit Agency</title> <!-- Bootstrap CSS --> <link rel="stylesheet" href="<?php
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ include '../../core.php'; $session->loginRequired('admin'); $Form = new Form(); if (!isset($_GET['id']) || empty($_GET['id'])) { $Form->setError('error', 'No admin ID found!'); $Form->return_msg_to('administrator.php'); } $id = cleanData($_GET['id']); $admin_query = mysql_query("SELECT * FROM " . TBL_USER . " WHERE id = '" . $id . "' LIMIT 1"); if (mysql_num_rows($admin_query) < 1) { $Form->setError('error', 'No admin found with given ID!'); $Form->return_msg_to('administrator.php'); } $admin_data = mysql_fetch_assoc($admin_query); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Life Department - Edit Administrator</title> <!-- Bootstrap CSS --> <link rel="stylesheet" href="<?php
public function validate_model() { $valid = true; /* * Validating redirecting conditions after submissions */ if ($this->form_redirect == "page" || $this->form_redirect == "url") { switch ($this->form_redirect) { case "page": if (empty($this->form_redirect_to_page)) { Form::setError($this->form_builder_id, RM_UI_Strings::get('MSG_REDIRECT_PAGE_INVALID')); $valid = false; } break; case "url": if (empty($this->form_redirect_to_url)) { Form::setError($this->form_builder_id, RM_UI_Strings::get('MSG_REDIRECT_URL_INVALID')); $valid = false; } break; } } /* * Validating form expiration configuration */ if ($this->form_should_auto_expire) { if (isset($this->form_options->form_expired_by) && !empty($this->form_options->form_expired_by)) { switch ($this->form_options->form_expired_by) { case "submissions": if (empty($this->form_options->form_submissions_limit)) { Form::setError($this->form_builder_id, RM_UI_Strings::get('MSG_EXPIRY_LIMIT_INVALID')); $valid = false; } break; case "date": if (empty($this->form_options->form_expiry_date)) { Form::setError($this->form_builder_id, RM_UI_Strings::get('MSG_EXPIRY_DATE_INVALID')); $valid = false; } break; case "both": if (empty($this->form_options->form_expiry_date) || empty($this->form_options->form_submissions_limit)) { Form::setError($this->form_builder_id, RM_UI_Strings::get('MSG_EXPIRY_BOTH_INVALID')); $valid = false; } break; } } else { $valid = false; Form::setError($this->form_builder_id, RM_UI_Strings::get('MSG_EXPIRY_INVALID')); } } if (isset($this->form_type) && $this->form_type == "1") { } if ($this->get_form_should_send_email() == "1") { if ($this->form_options->form_email_content == "") { Form::setError($this->form_builder_id, RM_UI_Strings::get('MSG_AUTO_REPLY_CONTENT_INVALID')); $valid = false; } if ($this->form_options->form_email_subject == "") { Form::setError($this->form_builder_id, RM_UI_Strings::get('MSG_AUTO_REPLY_SUBJECT_INVALID')); $valid = false; } } /* * Validating mailchimp settings */ /* if(get_option('rm_option_enable_mailchimp')=="yes" ) { if (isset($this->form_options->mailchimp_list) && $this->form_options->mailchimp_list == 0) { $valid = false; Form::setError($this->form_builder_id, RM_UI_Strings::get('MAILCHIMP_LIST_ERROR')); } } */ /* * Set error flag */ if (!$valid) { $this->errors = true; } return $valid; }
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require '../../core.php'; $session->loginRequired('admin', false); $Form = new Form(); //Agency ID if (!isset($_POST['agency_id']) || empty($_POST['agency_id'])) { $Form->setError('error', 'No Agency ID Found!'); $Form->return_msg_to('user.php'); } else { $agency_query = mysql_query("SELECT * FROM " . TBL_AGENCY . " WHERE id='" . cleanData($_POST['agency_id']) . "'"); if (mysql_num_rows($agency_query) < 1) { $Form->setError('error', 'No agency found!'); $Form->return_msg_to('user.php'); } } // First Name if (!isset($_POST['agency_name']) || empty($_POST['agency_name'])) { $Form->setError('error', 'Please write Agency Name'); } // Last Name if (!isset($_POST['primary_contact']) || empty($_POST['primary_contact'])) { $Form->setError('error', 'Please write Primary Contact'); } // Email
<?php /* Created on : Sep 15, 2014, 3:40:02 PM Author : me@rafi.pro Name : Mohammad Faozul Azim Rafi */ include '../../core.php'; $session->loginRequired('admin', false); $Form = new Form(); if (!isset($_POST['id'])) { $Form->setError('error', 'You must select a banner to delete!'); $Form->return_msg_to('banner.php'); } $id = cleanData($_POST['id']); $result = mysql_fetch_array(mysql_query('SELECT * FROM ' . TBL_BANNER . ' WHERE id="' . $id . '"')); if ($result == FALSE) { $Form->setError('error', 'Banner id not found!'); $Form->return_msg_to('banner.php'); } $delete_result = mysql_query('DELETE FROM ' . TBL_BANNER . ' WHERE id="' . $id . '"'); if ($delete_result) { if (file_exists(UPLOAD_DIR . $result['file_name'])) { unlink(UPLOAD_DIR . $result['file_name']); } $Form->setError('success', 'Banner delete success!'); $Form->return_msg_to('banner.php'); } $Form->setError('success', 'Banner delete failed!'); $Form->return_msg_to('banner.php');
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ include '../../core.php'; $session->loginRequired('admin'); $Form = new Form(); if (!isset($_GET['id']) || empty($_GET['id'])) { $Form->setError('error', 'No user ID found!'); $Form->return_msg_to('user.php'); } $id = cleanData($_GET['id']); $user_query = mysql_query("SELECT * FROM " . TBL_USER . " WHERE id = '" . $id . "' LIMIT 1"); if (mysql_num_rows($user_query) < 1) { $Form->setError('error', 'No user found with given ID!'); $Form->return_msg_to('user.php'); } $user_data = mysql_fetch_assoc($user_query); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Life Department - Edit User</title> <!-- Bootstrap CSS --> <link rel="stylesheet" href="<?php