function validate_unique_email($udm) { if (!AMP_params('btnUdmSubmit')) { return; } if (AMP_params('Email') && !AMP_params('uid')) { $finder = new AMP_System_User_Profile(AMP_dbcon()); $existing_accounts = $finder->find(array('Email' => AMP_params('Email'), 'modin' => 20)); if (!empty($existing_accounts)) { AMP_flashMessage('The email address you entered is already associated with an account and must be unique to create a new one. Are you already a member? If so <a href="forgot_password.php?login_type=content">you can recover your password here</a>.', $error = true); AMP_redirect('/form.php?id=' . $udm->instance); exit; } } }
$udm = new UserDataInput(AMP_dbcon(), 20); $udm->getUser($AMP_Authen_Handler->getUserId()); // Hide fields that should be present on the signup form, but not on the edit form // Custom1 = username // Custom2 = password // remember users email field so we can use it later when we save $email = $udm->fields['Email']; // Remove non-editable fields so that they don't display on the form $non_editable_fields = array('custom1', 'custom2', 'Email'); foreach ($non_editable_fields as $field_name) { unset($udm->fields[$field_name]); } // if there is POST data, save and redirect back to self. if (isset($_POST['btnUdmSubmit'])) { // add email field back in so DIA syncing works if (empty($udm->fields['Email'])) { $udm->fields['Email'] = $email; //add the email back in the post so that the udm save function doesn't throw a validation error. $_POST['Email'] = $email['value']; } $udm->saveUser(); AMP_flashMessage('Profile Updated'); AMP_redirect('profile.php'); } //BaseModuleIntro uses this local variable to decide what intro text to display for this page. //$intro_id = $udm->modTemplateID; $intro_id = AMP_CONTENT_EDIT_PROFILE_INTROTEXT_ID; AMP_directDisplay('<div id="' . sprintf(AMP_UDM_FORM_CONTAINER, 20) . '">' . $udm->output() . '</div>'); require_once 'AMP/BaseTemplate.php'; require_once 'AMP/BaseModuleIntro.php'; require_once 'AMP/BaseFooter.php';
function bail($message, $redirect_url = '/search.php') { AMP_flashMessage($message, true); AMP_redirect($redirect_url); die; }
mail($MM_email_faq, "faq needs response", "There is a new FAQ that needs answering: " . $_POST["question"] . " From:" . $_POST["email"] . " \nPlease visit {$Web_url}/system/faq.php?action=list to answer", "From: " . AMPSystem_Email::sanitize($MM_email_from) . "\nX-Mailer: My PHP Script\n"); } require "Connections/insetstuff.php"; require "Connections/dataactions.php"; header("Location: faq.php"); } $type__MMColParam = "0"; if (isset($_GET["typeid"])) { $type__MMColParam = mysql_real_escape_string($_GET["typeid"]); } $called__MMColParam = "1"; if (isset($_GET["id"])) { $called__MMColParam = mysql_real_escape_string($_GET["id"]); } $type = $dbcon->CacheExecute("SELECT * FROM faqtype WHERE id = " . $type__MMColParam . "") or AMP_redirect('search.php'); $called = $dbcon->CacheExecute("SELECT * FROM faq WHERE id = " . $called__MMColParam . "") or AMP_redirect('search.php'); echo '<table width="100%" border="0" cellspacing="0" cellpadding="10" valign="top"><tr><td>'; #show question if ($_GET["id"] != NULL) { echo '<p class="question">' . $called->Fields("question") . '</p><p class="text">' . $called->Fields("longanswer") . '</p>'; } #show form if ($_GET["showask"] == 1) { ?> <form name="form1" method="POST" action="faq.php"> <table width="100%" border="0" cellspacing="0" cellpadding="3" class="text"> <tr> <td class="form"><b>Question</b></td><td> <textarea name="question" wrap="VIRTUAL" cols="35" rows="5"></textarea> </td></tr> <tr>
<?php require_once 'AMP/Base/Config.php'; require_once 'AMP/Auth/Password/Reset.php'; require_once 'AMP/Auth/Password/Reset/Request/Form.php'; $login_type = AMP_params('login_type'); if (!($login_type && $login_type == 'content')) { trigger_error('attempted to request password reset for non-content login'); AMP_redirect(AMP_CONTENT_URL_FRONTPAGE); } $pw_reset = new AMP_Auth_Password_Reset($login_type); if ($pw_reset->success()) { AMP_flashMessage('You should receive an email message allowing you to reset your password shortly.'); AMP_redirect(AMP_CONTENT_URL_FRONTPAGE); } else { if ($pw_reset->submitted()) { AMP_flashMessage('I can\'t find that account, please try again.'); } $form = new AMP_Auth_Password_Reset_Request_Form(); $form->Build(); AMP_directDisplay($form->execute()); $intro_id = AMP_CONTENT_PUBLICPAGE_ID_PASSWORD_RESET; require_once 'AMP/BaseTemplate.php'; require_once 'AMP/BaseModuleIntro.php'; require_once 'AMP/BaseFooter.php'; }