function generateConfirm($edit) { $dataInvalid = $this->isDataInvalid($edit); if ($this->formbuilder) { $this->formbuilder->bulk_set_answers($_POST[$this->event->formkey()]); $dataInvalid .= $this->formbuilder->answers_invalid(); } if ($dataInvalid) { error_exit($dataInvalid . '<br>Please use your back button to return to the form, fix these errors, and try again.'); } $output = para('Please confirm that this data is correct and click the submit button to proceed to the payment information page.'); $output .= form_hidden('edit[step]', 'submit'); $fields = array('Registration Status' => 'payment', 'Notes' => 'notes'); $rows = array(); foreach ($fields as $display => $column) { array_push($rows, array($display, form_hidden("edit[{$column}]", $edit[$column]) . check_form($edit[$column]))); } $output .= form_group('Registration details', "<div class='pairtable'>" . table(null, $rows) . '</div>'); if ($this->formbuilder) { $form = $this->formbuilder->render_viewable(); $form .= $this->formbuilder->render_hidden(); $output .= form_group('Registration answers', $form); } $output .= para(form_submit('submit')); return form($output); }
function check_form(&$value, &$error_array, $exempt_array = array(), $key = NULL) { $collect_error_array = array(); $index = 0; // display ( $exempt_array ) ; // display ( $value ) ; foreach ($value as $array_key => $array_value) { if (is_array($array_value)) { // echo "Is ARRAY<BR>\n" ; check_form($array_value, $error_array, &$exempt_array, &$array_key); } else { $vars = trim($array_value); if ($key === NULL) { // echo "Non array <br>\n" ; if (isset($array_key) && $vars != "") { validate($array_key, $vars, &$collect_error_array, &$index); // If the value is valid } else { if (!in_array($array_key, $exempt_array)) { // echo "Error \$key: " . $array_key . " \$value: " . $array_value . " <br>\n" ; $collect_error_array[$index] = " This entry cannot be empty.<br>\n"; } } } else { if (isset($array_key) && $vars != "") { // echo "ARRAY key passed <br>\n" ; validate($key, $vars, &$collect_error_array, &$index, &$array_key); // If the value is valid } else { if (!in_array($key, $exempt_array)) { // echo "Error \$key: " . $key . " \$value: " . $array_value . " <br>\n" ; $collect_error_array[$index] = " This entry cannot be empty.<br>\n"; } } } } if ($key === NULL) { $index = 0; if (count($collect_error_array) > 0) { // echo "Upper error<br>\n" ; $error_array[$array_key] = $collect_error_array; $collect_error_array = array(); } } else { $index++; } } if ($key !== NULL) { if (count($collect_error_array) > 0) { // echo "ARRAY error<br>\n" ; $error_array[$key] = $collect_error_array; } } }
function smarty_hidden_fields($params, &$smarty) { if (empty($params['group'])) { $params['group'] = 'edit'; } $output = ''; if (array_key_exists('fields', $params) && !empty($params['fields'])) { foreach ($params['fields'] as $name => $value) { $output .= "<input type=\"hidden\" name=\"{$params['group']}[{$name}]\" value=\"" . check_form($value) . "\" />\n"; } } return $output; }
function process() { global $lr_session; # Nuke HTML just in case $team_name = check_form($this->team->name, ENT_NOQUOTES); $this->title = "{$team_name} » Move"; $edit = $_POST['edit']; if ($edit['step']) { if ($edit['target'] < 1) { error_exit("That is not a valid league to move to"); } if (!$lr_session->has_permission('league', 'manage teams', $edit['target'])) { error_exit("Sorry, you cannot move teams to leagues you do not coordinate"); } $targetleague = League::load(array('league_id' => $edit['target'])); if (!$targetleague) { error_exit("You must supply a valid league to move to"); } if ($targetleague->league_id == $this->team->league_id) { error_exit("You can't move a team to the league it's currently in!"); } } if ($edit['swaptarget']) { $target_team = Team::load(array('team_id' => $edit['swaptarget'])); if (!$target_team) { error_exit("You must supply a valid target team ID"); } if ($target_team->league_id == $this->team->league_id) { error_exit("You can't swap with a team that's already in the same league!"); } if ($target_team->league_id != $targetleague->league_id) { error_exit("You can't swap with a team that's not in the league you want to move to!"); } if (!$lr_session->has_permission('league', 'manage teams', $target_team->league_id)) { error_exit("Sorry, you cannot move teams to leagues you do not coordinate"); } } switch ($edit['step']) { case 'perform': $sourceleague = League::load(array('league_id' => $this->team->league_id)); $this->perform($targetleague, $target_team); local_redirect(url("league/view/" . $sourceleague->league_id)); case 'confirm': return $this->confirm($targetleague, $target_team); case 'swaptarget': return $this->choose_swaptarget($targetleague); default: return $this->choose_league(); } error_exit("Error: This code should never be reached."); }
function form_reset($value, $name = "reset") { return "<input type=\"reset\" name=\"{$name}\" value=\"" . check_form($value) . "\" />\n"; }
if (!empty($_POST['server_name']) && !empty($_POST['user_name']) && !empty($_POST['password']) && !empty($_POST['database'])) { global $server_name; $server_name = $_POST['server_name']; global $user_name; $user_name = $_POST['user_name']; global $password; $password = $_POST['password']; global $database; $database = $_POST['database']; return true; } else { echo "Заполните все поля"; } } } if (check_form()) { $db = DbSimple_Generic::connect('mysqli://*****:*****@localhost/form'); $db->select("SET NAMES utf8"); $db->select("SET time_zone = '+00:00'"); $db->select("SET foreign_key_checks = 0"); $db->select("SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'"); $db->select("DROP TABLE IF EXISTS `ads`"); $db->select("CREATE TABLE `ads` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `private` tinyint(4) NOT NULL,\n `seller_name` varchar(10) NOT NULL,\n `email` varchar(15) NOT NULL,\n `allow_mails` tinyint(4) NOT NULL,\n `phone` varchar(12) NOT NULL,\n `location_id` int(11) NOT NULL,\n `category_id` int(11) NOT NULL,\n `title` varchar(30) NOT NULL,\n `description` varchar(255) NOT NULL,\n `price` varchar(10) NOT NULL,\n PRIMARY KEY (`id`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8"); $db->select("INSERT INTO `ads` (`id`, `private`, `seller_name`, `email`, `allow_mails`, `phone`, `location_id`, `category_id`, `title`, `description`, `price`) VALUES\n (34,1,'4654','4446',1,'464',641490,25,'4564','4465','44'),\n (36,1,'464','446',1,'464',641780,24,'4664','4646','4664')"); $db->select("DROP TABLE IF EXISTS `categories`"); $db->select("CREATE TABLE `categories` (\n `category_id` varchar(3) NOT NULL,\n `category` varchar(10) NOT NULL\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8"); $db->select("INSERT INTO `categories` (`category_id`, `category`) VALUES\n ('24','Квартиры'),\n ('23','Комнаты'),\n ('25','Дома, дачи')"); $db->select("DROP TABLE IF EXISTS `citys`"); $db->select("CREATE TABLE `citys` (\n `location_id` varchar(10) NOT NULL,\n `city` varchar(30) NOT NULL\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8"); $db->select("INSERT INTO `citys` (`location_id`, `city`) VALUES\n ('641780','Новосибирск'),\n ('641490','Барабинск'),\n ('641510','Бердск')"); $db->select("DROP TABLE IF EXISTS `private`");
//Establish connection with database // Will be removed. $db = adodb_connect(); if (!$db) { echo "Could not connect to database server - please try later."; exit; } if ($_POST["Submit"] == "Submit") { $error_array = array(); $exempt_array = array("logofile"); //$exempt_array = array () ; if ($_FILES["logofile"]["name"] != "") { $vars = array_merge($_POST, $_FILES); } else { $vars = $_POST; } check_form($vars, $error_array, &$exempt_array); } if (count($error_array) == 0 && count($_POST) > 0 && $_POST["Submit"] == "Submit") { include "{$php_root_path}" . "{$privilege_root_path}/process_edit_conference_info.php"; } else { do_html_header("Edit Conference Information"); /*echo "Some error"; echo "<pre>"; print_r($error_array); echo "</pre>"; echo "<br>File type: ".$_FILES["logofile"]["type"];*/ if ($_POST["Submit"] == "Undo Changes") { unset($_POST); /* unset ( $_POST["name"] ) ; unset ( $_POST["codename"] ) ;
<input type="hidden" name="SessionID" value="<?php echo $session->SessionID; ?> "> <input type="submit" name="Submit" value="Delete"> <input type="submit" name="Submit" value="Cancel"> </form> </td> </tr> </table> <?php exit; } $error_array = array(); if ($_POST["Submit"] == "Submit") { check_form($_POST, &$error_array, array("SessionID")); if (count($error_array) == 0) { $session = new Session(); $session->SessionID = $_POST["SessionID"]; $session->SessionName = $_POST["SessionName"]; $session->TrackID = $_POST["TrackID"]; if (array_key_exists("SessionTrackID", $_POST)) { $session->SessionTrackID = $_POST["SessionTrackID"]; } $session->PresentationTypeID = $_POST["PresentationTypeID"]; $session->StartTime = sprintf("%s %02d:%02d:00", $_POST["StartDate"], $_POST["StartHour"] % 12 + ($_POST["StartMeridiem"] == "pm" ? 12 : 0), $_POST["StartMinute"]); $session->EndTime = sprintf("%s %02d:%02d:00", $_POST["EndDate"], $_POST["EndHour"] % 12 + ($_POST["EndMeridiem"] == "pm" ? 12 : 0), $_POST["EndMinute"]); $session->RoomID = $_POST["RoomID"]; $session->ChairID = $_POST["ChairID"]; if ($_POST["SessionID"] && !$_GET["duplicate"]) { $result = update_session($session);
?> </section> <div class="formulaire"> <?php extract($_POST); $css_lab_err = "class=\"erreur-label\""; $css_input_err = "class=\"erreur-label\""; require_once 'src/php/form.php'; if (!isset($erreurrrr)) { $erreurrrr[] = 0; } if (isset($_POST['submit'])) { check_form(); /*Extraction des valeurs en variable*/ /*On enregistre dans la BDD*/ // if (isset($first_name) and isset($last_name) and isset($sex) and isset($age) and isset($home) and isset($postal_code) and isset($study)) { $first_name = htmlspecialchars($first_name); $last_name = htmlspecialchars($last_name); $sex = htmlspecialchars($sex); $age = htmlspecialchars($age); $home = htmlspecialchars($home); $postal_code = htmlspecialchars($postal_code); $study = htmlspecialchars($study); if (!isset($work)) { $work = NULL; } $work = htmlspecialchars($work);
function import_csv($file_for_import = '') { global $t, $vars, $import_begin_time, $total_added, $csv_duplicate_logins, $amember_duplicate_logins, $input_fields, $fixed_input_fields, $member_additional_fields; $check_fields_array = array_merge($input_fields, $fixed_input_fields); foreach ($check_fields_array as $field_name) { $_SESSION['predefined_fields'][$field_name] = $vars[$field_name]; } $delim = $vars['delim']; if (!$file_for_import) { $file_for_import = $vars['file_for_import']; } if (!check_form()) { if ($f = @fopen($file_for_import, 'r')) { $line = fgets($f, 4096); if (preg_match("/\n/", $line) && preg_match("/\r/", $line)) { $l = $line; } elseif (preg_match("/\r/", $line)) { $l = preg_split("/\r/", $line); $l = $l[0]; } else { $l = $line; } $l = explode($delim, $l); @fclose($f); import_select_fields($file_for_import, $delim, $l); exit; } else { import_upload(); exit; } } if ($f = @fopen($file_for_import, 'r')) { while ($line = fgets($f, 4096)) { if (!$csv_new_line) { if (preg_match("/\n/", $line) && preg_match("/\r/", $line)) { $csv_new_line = 'n'; $line_array = explode($delim, $line); import_import($line_array); } elseif (preg_match("/\r/", $line)) { // bad \r file $csv_new_line = 'r'; $new_line_lastpos = strrpos($line, "\r"); $good_line = substr($line, 0, $new_line_lastpos); $tmp_line = substr($line, $new_line_lastpos); if (substr($tmp_line, 0, 1) == "\r") { $tmp_line = substr($tmp_line, 1); } $tmp_line_array = preg_split("/\r/", $good_line); foreach ($tmp_line_array as $tmp_line_good) { $line_array = explode($delim, $tmp_line_good); import_import($line_array); } } else { $line_array = explode($delim, $line); import_import($line_array); } } else { if ($csv_new_line == 'r') { if ($tmp_line) { $new_line_firstpos = strpos($line, "\r"); $tmp_line .= substr($line, 0, $new_line_firstpos - 1); $line_array = explode($delim, $tmp_line); import_import($line_array); $new_line_lastpos = strrpos($line, "\r"); $good_line = substr($line, $new_line_firstpos, $new_line_lastpos - 1); $tmp_line_array = preg_split("/\r/", $good_line); foreach ($tmp_line_array as $tmp_line_good) { $line_array = explode($delim, $tmp_line_good); import_import($line_array); } $tmp_line = substr($line, $new_line_lastpos); if (substr($tmp_line, 0, 1) == "\r") { $tmp_line = substr($tmp_line, 1); } } } else { $line_array = explode($delim, $line); import_import($line_array); } } } @fclose($f); if ($tmp_line) { $line_array = explode($delim, $tmp_line); import_import($line_array); } import_import(array(), 1); } else { import_upload(); exit; } $title = "Import Finished"; $import_took_time = time() - $import_begin_time; $t->assign('title', $title); $t->assign('total_added', $total_added); $t->assign('csv_duplicate_logins', $csv_duplicate_logins); $t->assign('amember_duplicate_logins', $amember_duplicate_logins); $t->assign('import_took_time', $import_took_time); $t->assign('file_for_import', $file_for_import); admin_log("Import users"); $t->display('admin/import_finished.html'); exit; }
$ThisPrat = $rsP->FetchRow(); $p = $ThisPrat[pr_ref_idcliente]; $titPrat = $ThisPrat[pr_codice]; //Dati del contatto $qC = "SELECT * FROM contact WHERE Id = " . $p; $rsC = $DB->Execute($qC); $ThisCont = $rsC->FetchRow(); $c = $ThisCont[nome]; $St1 = $CONF[gmail_url]; $StGcal = $CONF[gcal_url]; $StRic = $c; $Str2 = "&nvp_site_mail=Cerca+nella+posta"; $url = $St1 . $StRic . $Str2; $mailto = "mailto:?subject=" . $titPrat; if ($_GET[form_id] == $thissearch[form][name]) { $error = check_form($thissearch[form], $_GET, $page); if ($error == 1) { if (count($_GET[ref_prat][realval]) == 1 && strlen($_GET[ref_prat][realval]) > 0) { $PAGE_ELEMENT[PAGE][1][0][param] = $_GET[ref_prat][realval][0]; $PAGE[PAGE_INTITLE] .= " <span > ( <a href='{$mailto}'>" . DOCUMENT_NEW_GMAIL . "</a> )\r\n\r\n( <a target=\"\" href=\"#\" onclick=\"javascript:ApriPopUp('{$StGcal}')\">" . DOCUMENT_GCAL . "</a> )\r\n</span>"; } //INIZIO PAGINA print ' <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> <iframe style="display: inline;" id="Fr1" name="Frame1" src=' . $url . ' height="399" width="100%" frameborder=0 MARGINWIDTH="0" marginheight="0" ></iframe> <br> '; //FINE PAGINA if (strlen($_GET[testo]) > 4) { $resfile = searchDocuments($_GET[testo]); if (count($resfile) == 0) {
function generateConfirm($edit) { $dataInvalid = $this->isDataInvalid($edit); if ($dataInvalid) { error_exit($dataInvalid . "<br>Please use your back button to return to the form, fix these errors, and try again"); } $output = form_hidden("edit[step]", "perform"); $ratings = field_rating_values(); if ($edit['parent_fid']) { $parent = Field::load(array('fid' => $edit['parent_fid'])); $rows = array(); $rows[] = array("Name:", $parent->name); $rows[] = array("Status:", form_hidden('edit[status]', $edit['status']) . check_form($edit['status'])); $rows[] = array("Number:", form_hidden('edit[num]', $edit['num']) . check_form($edit['num'])); $rows[] = array("Field Rating:", form_hidden('edit[rating]', $edit['rating']) . $ratings[$edit['rating']]); $rows[] = array("Parent Field:", form_hidden('edit[parent_fid]', $edit['parent_fid']) . $parent->fullname); } else { $rows = array(); $rows[] = array("Name:", form_hidden('edit[name]', $edit['name']) . check_form($edit['name'])); $rows[] = array("Status:", form_hidden('edit[status]', $edit['status']) . check_form($edit['status'])); $rows[] = array("Number:", form_hidden('edit[num]', $edit['num']) . check_form($edit['num'])); $rows[] = array("Field Rating:", form_hidden('edit[rating]', $edit['rating']) . $ratings[$edit['rating']]); $rows[] = array("Is indoor:", form_hidden('edit[is_indoor]', $edit['is_indoor']) . ($edit['is_indoor'] ? 'Yes' : 'No')); $rows[] = array("Code:", form_hidden('edit[code]', $edit['code']) . check_form($edit['code'])); $rows[] = array("Region:", form_hidden('edit[region]', $edit['region']) . check_form($edit['region'])); $rows[] = array("Street:", form_hidden('edit[location_street]', $edit['location_street']) . check_form($edit['location_street'])); $rows[] = array("City:", form_hidden('edit[location_city]', $edit['location_city']) . check_form($edit['location_city'])); $rows[] = array("Province:", form_hidden('edit[location_province]', $edit['location_province']) . check_form($edit['location_province'])); $rows[] = array("Location Map:", form_hidden('edit[location_url]', $edit['location_url']) . check_form($edit['location_url'])); $rows[] = array("Layout Map:", form_hidden('edit[layout_url]', $edit['layout_url']) . check_form($edit['layout_url'])); $rows[] = array("Driving Directions:", form_hidden('edit[driving_directions]', $edit['driving_directions']) . check_form($edit['driving_directions'])); $rows[] = array("Parking Details:", form_hidden('edit[parking_details]', $edit['parking_details']) . check_form($edit['parking_details'])); $rows[] = array("Transit Directions:", form_hidden('edit[transit_directions]', $edit['transit_directions']) . check_form($edit['transit_directions'])); $rows[] = array("Biking Directions:", form_hidden('edit[biking_directions]', $edit['biking_directions']) . check_form($edit['biking_directions'])); $rows[] = array("Public Washrooms:", form_hidden('edit[washrooms]', $edit['washrooms']) . check_form($edit['washrooms'])); $rows[] = array("Special Instructions:", form_hidden('edit[public_instructions]', $edit['public_instructions']) . check_form($edit['public_instructions'])); $rows[] = array("Private Instructions:", form_hidden('edit[site_instructions]', $edit['site_instructions']) . check_form($edit['site_instructions'])); $rows[] = array("Sponsorship:", form_hidden('edit[sponsor]', $edit['sponsor']) . check_form($edit['sponsor'])); } $rows[] = array(form_submit('Submit'), ""); $output .= "<div class='pairtable'>" . table(null, $rows) . "</div>"; return form($output); }
<?php $php_root_path = ".."; $privilege_root_path = "/user"; require_once "{$php_root_path}/includes/include_all_fns.inc"; //require_once("$php_root_path"."/admin/includes/libmail.php"); $homepage->showmenu = 0; $err_message = " Unable to process your request due to the following problems: <br>\n"; $error_array = array(); check_form($_POST, $error_array); if (count($error_array) == 0 && count($_POST) > 0) { if (forget_password($_POST["username"], &$err_message)) { do_html_header("Reseting Password Successful", &$err_message); echo "Your password has been reset and you will receive a new password to your email address shortly.<br><br>Go to the <a href='{$php_root_path}/index.php'>Login</a> page"; do_html_footer(&$err_message); exit; } else { do_html_header("Reseting Password Failed", &$err_message); $err_message .= " <br><br> Try <a href='forget_pwd.php'>Again</a>? <br>Go to the <a href='{$php_root_path}/index.php'>Login</a> page. <br>\n"; } } else { do_html_header("Reset Password", &$err_message); } ?> <form action="forget_pwd.php" method="post" name="loginForm" id="loginForm"> <table width="80%" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="24" colspan="2">Not registered. <a href="registration.php">Sign up for an account.</a></td> </tr> <tr> <td height="10" colspan="2">Hint: Use your email address as UserName.</td>
$all = select("SELECT * from " . PREFIX . "lng WHERE id={$id}"); $all = $all[0]; echo "<p>Naozaj chcete vymazať túto položku?</p>"; foreach ($all as $key => $a) { echo "{$key} => {$a} <br />"; } echo "\n <p>\n <a href=\"?vyber={$vyber}&action=del&id={$all['id']}&confirm=OK\">Áno, vymazať</a>\n ----- \n <a href=\"?vyber={$vyber}\">Nie, vrátiť sa späť</a>\n </p>"; } } if ($action == "insert") { if ($_POST[submit]) { $id = check_sql($_POST[id]); $lng_id = check_sql($_POST[lng_id]); $table = check_sql($_POST[table]); $text = check_sql($_POST[text]); $confirm = check_form($text); if (is_numeric($id) and is_numeric($lng_id)) { $query = "INSERT INTO " . PREFIX . "lng_{$table} (id, id_lng, id_{$table}, text ) \n VALUES (\"\", \"{$lng_id}\", \"{$id}\", \"{$text}\")"; echo $query; $result_menu = mysql_query($query, $GLOBALS[link]) or die("SQL nebol uspesne napojeny<br>" . $query . " <br> " . mysql_error($GLOBALS[link])); if ($set != "") { header("location: ?vyber={$set}&action=edit&id={$id}"); } else { header("location: ?vyber={$table}&action=edit&id={$id}"); } } else { //header("location: ?vyber=$vyber&action=$action&lng=$lng&meno=$meno&title=$title&meta_descr=$meta_descr"); } } else { $id = check_get($_GET[id]); $table = check_get($_GET[table]);
<?php error_reporting(0); include "dbconnect.php"; include "function.inc.php"; #如果php配置中,magic_quotes_gpc没有被设置,则执行过滤字符串。 $form = check_form($_POST["edit"]); $form["reg_time"] = date("Y-m-d H:i:s"); $form["pass"] = md5($form["pass"]); extract($form); $sql = "insert into users( name,password,sex,mail,tel,reg_time) "; #这里{}符号是代表在字符串中引用当前环境的变量 $sql .= " values('{$name}',"; $sql .= " '{$pass}',"; $sql .= " '{$sex}',"; $sql .= " '{$mail}', "; $sql .= " '{$tel}', "; $sql .= " '{$reg_time}') "; $res = mysql_query($sql); if (!$res) { //die("数据库出错,请返回重试。"); die("mysql error:" . mysql_error()); } else { echo "success"; } header("Location:msg.php?m=register_success");
$thisform[onpost] = str_replace("type::add", "type::upd", $thisform[onpost]); $thisform[Fields][send][content] = "submit||" . ADMIN_TER_PROC_UPD . "||"; } else { $PAGE[PAGE_INTITLE] = ADMIN_TER_PROC_ADD; $PAGE[TXT_TITLE] = ADMIN_TER_PROC_ADD; $response[title] = ADMIN_TER_PROC_ADD_DONE; $response[text] = ADMIN_TER_PROC_ADD_DONE_TXT . "<br><br>" . make_button("ter_proc_view.php", ADMIN_TER_PROC_BACK_LIST); $thisform[Fields][send][content] = "submit||" . ADMIN_TER_PROC_ADD . "||"; } if ($_POST[form_id] == $thisform["name"]) { if (isset($_POST[form_page])) { $page = $_POST[form_page]; } else { $page = 1; } $error = check_form($thisform, $_POST, $page); //echo $error; if ($error == 1) { $manage = manage_post($thisform, $error, $_POST, $_GET[id]); } else { print draw_form($thisform, $module, $error, $_POST, $page); } if ($manage == 1) { //echo $thisform["name"];echo $manage; $page = $_POST[form_page] + 1; print draw_form($thisform, $module, $error, $_POST, $page); } elseif ($manage > 1) { print draw_response($response); } } else { print draw_form($thisform, $module, "", $result);
$vars['i_agree']++; foreach ($vars as $k => $v) { $t->_smarty_vars['request'][$k] = $v; } } if (!$config['login_dont_lowercase']) { $vars['login'] = strtolower($vars['login']); } if ($config['generate_login']) { $vars['login'] = generate_login($vars); } if ($config['generate_pass']) { $vars['pass'] = $vars['pass0'] = $vars['pass1'] = generate_password($vars); } ///// if ($vars['do_affiliate'] && check_form()) { /* //check for agreement $display_agreement = 0; foreach ((array)$vars['product_id'] as $pid){ $product = $db->get_product($pid); if ($product['need_agreement']) $display_agreement++; } if ($display_agreement && !$vars['i_agree']){ display_agreement(serialize($vars)); // defined in the product.inc.php exit(); } */ $login = $vars['login'];
$php_root_path = ".."; require_once "{$php_root_path}/includes/include_all_fns.inc"; require_once "{$php_root_path}/includes/page_includes/page_fns.php"; $err_message = " Unable to process your request due to the following problems: <br>\n"; $homepage->showmenu = 0; if ($_POST["Submit"] == "Download" && $_POST["final"]) { // the next three lines force an immediate download of the zip file: // header("Content-type: application/octet-stream"); header('Content-Type: text/x-delimtext; name="preferences.inc"'); header('Content-disposition: attachment; filename="preferences.inc"'); echo stripslashes($_POST["final"]); exit; } $error_array = array(); $exempt_array = array_merge(get_user_details_form_exemptions(), array("DB_PREFIX", "DB_PASSWORD")); check_form($_POST, $error_array, &$exempt_array); if ($_POST["pwdConfirm"] != $_POST["password"]) { $error_array["password"][] = " Your new password and confirmation password are inconsistent. <br>\n"; $error_array["pwdConfirm"][] = " Your new password and confirmation password are inconsistent. <br>\n"; do_html_header("Setup Database", &$err_message); } else { // echo "<br>\ncount: " . count ( $error_array ) . "<br>\n" ; if (count($error_array) == 0 && count($_POST) > 0) { // echo "<br>\nBOLD First<br>\n" ; // $link = mysql_connect($_POST["db_hosdtname"], $_POST["db_username"], $_POST["db_pwd"]) // or die("Could not connect"); // exit ; include '../install/process_install.php'; // echo "<br>\nBOLD Last<br>\n" ; } else { do_html_header("Installation of COMMENCE System", &$err_message);
function mass_subscribe() { global $vars, $db, $t, $config; $vars = unserialize($vars['vars']); if (!check_form()) { display_form(); return; } $added = 0; foreach (select_members() as $member_id => $m) { switch ($vars['assign_date']) { case 'SAME': $b = $m['begin_date']; $e = $m['expire_date']; break; case 'FIXED': $b = date('Y-m-d', strtotime($vars['period_begin'])); $e = date('Y-m-d', strtotime($vars['period_end'])); break; case 'LIFETIME': $b = date('Y-m-d'); $e = '2037-12-31'; break; default: die("Unknown assign_date method - internal error"); } // print "$b=$e<br />"; $p = array('member_id' => $member_id, 'product_id' => $vars['product_id'], 'begin_date' => $b, 'expire_date' => $e, 'completed' => 1, 'paysys_id' => 'manual', 'receipt_id' => $vars['receipt_id'], 'amount' => $vars['amount']); $db->add_payment($p); $added++; } admin_log("Mass Subscribe {$sf} to Product #{$vars['product_id']}", "products", $vars['product_id']); $t->assign('text', "{$added} subscriptions added succesfully."); $t->assign('link', "products.php"); $t->display("admin/mass_subscribed.html"); }