function eventRegistrationValidation(EventControler $evtcl) { $fields = $evtcl->fields; $do_user_rel = new UserRelations(); if ($evtcl->errPage != '') { $errorpage = $evtcl->errPage; } else { $errorpage = "user_register.php"; } if (trim($fields["firstname"]) == "" || trim($fields["lastname"]) == "" || trim($fields["email"]) == "" || trim($fields["username"]) == "" || trim($fields["password"]) == "" || trim($evtcl->fieldrepeatpass["password"]) == "") { $evtcl->validation_fail = 'Yes'; $msg = "You must fill the required fields"; $errorpage = $evtcl->errorpage; $dispError = new Display($errorpage); $dispError->addParam("id", $evtcl->id); $dispError->addParam("message", $msg); $evtcl->setDisplayNext($dispError); } elseif (trim($fields["password"]) != $do_user_rel->encrypt($evtcl->fieldrepeatpass["password"])) { $evtcl->validation_fail = 'Yes'; $msg = "Both the Password are not matching"; $errorpage = $evtcl->errorpage; $dispError = new Display($errorpage); $dispError->addParam("id", $evtcl->id); $dispError->addParam("message", $msg); $evtcl->setDisplayNext($dispError); } else { $evtcl->validation_fail = 'No'; } }
</td><td class="layout_rcolumn"> <div class="contentfull"> <?php if ($_SESSION['in_page_message'] != '') { echo '<div style="margin-left:0px;">'; echo '<div class="messages_unauthorized">'; echo htmlentities($_SESSION['in_page_message']); $_SESSION['in_page_message'] = ''; echo '</div></div><br /><br />'; } echo nl2br($_SESSION['do_invoice']->invoice_address); //echo '<br />'. _('Total due :').'<b>$'. number_format($invoice_cal_data["total_due_amt"],2, '.', ',' ).'</b>'; echo '<br />' . _('Total due :') . '<b>' . $_SESSION['do_invoice']->viewAmount($_SESSION['do_invoice']->amt_due) . '</b>'; echo '<br /><br />'; $do_user_rel = new UserRelations(); $invoice_url = $GLOBALS['cfg_ofuz_site_http_base'] . 'inv/' . $do_user_rel->encrypt($_SESSION['do_invoice']->idinvoice) . '/' . $do_user_rel->encrypt($_SESSION['do_invoice']->idcontact); $do_payment = new Event("do_invoice->eventProcessAuthNetPayment"); $do_payment->addParam("is_rec", $is_recurrent); $do_payment->addParam("is_cc", $id_rec_cc); // send 0 if not in recurrent else send 1 $do_payment->addParam("goto", $invoice_url); // send 0 if no CC else send 1 $do_payment->addParam("error_page", "invoice_pay_auth.php"); echo $do_payment->getFormHeader(); echo $do_payment->getFormEvent(); echo $_SESSION['do_invoice']->prepareAuthnetForm("Authnet", $_SESSION['do_invoice']->amt_due); //sending the amout ?> </div> </td></tr></table> <div class="spacerblock_40"></div>
<?php echo _('Embed code to insert in your blog or web site'); ?> <div> <textarea rows="2" cols="100"><script type="text/javascript" src="<?php echo $GLOBALS['cfg_ofuz_site_http_base'] . 'js_form.php?fid=' . $_SESSION['do_userform']->getPrimaryKeyValue(); ?> "></script> </textarea> </div> <!-- Display webform html start --> <div> <?php $fid = $_SESSION['do_userform']->getPrimaryKeyValue(); $do_user_rel = new UserRelations(); $efid = $do_user_rel->encrypt($fid); $do_webformuser = new WebFormUser(); $do_webformuser->getId($_SESSION['do_userform']->getPrimaryKeyValue()); $do_webformuser->sessionPersistent("do_webformuser", "index.php", OFUZ_TTL); $do_webformuser->newForm('do_webformuser->eventAddContact'); if ($do_webformuser->email_alert == 'y') { $do_webformuser->form->addEventAction("do_webformuser->eventSendEmailAlert", 300); } $js = ''; if (strlen($do_webformuser->title) > 0) { $js .= $do_webformuser->title . '<br />'; } if (strlen($do_webformuser->description) > 0) { $js .= $do_webformuser->description . '<br />'; } $uid = $do_webformuser->iduser;
/** * Method to send Send Invoice Apporove/Reject Email to the Invoice Owner * @param $iduser -- INT * @param $idinvoice -- INT * @param $status -- STRING * @param $rejected_reason -- STRING */ function sendInvoiceApproveReject($iduser, $idinvoice, $status, $rejected_reason = "") { $do_inv = new Invoice(); $do_inv_user = new User(); $do_contact = new Contact(); $do_inv->getId($idinvoice); $do_inv_user->getId($iduser); $do_contact->getId($do_inv->idcontact); $total_due = $do_inv->amt_due; $inv_num = $do_inv->num; $inv_desc = $do_inv->description; $inv_address = nl2br($this->Only1brFirstLineBlack($do_inv->invoice_address)); $contact_name = $do_contact->firstname . ' ' . $do_contact->lastname; if ($do_contact->email_address != '') { $contact_email = $do_contact->email_address; } else { $ContactEmail = $do_contact->getChildContactEmail(); if ($ContactEmail->getNumRows()) { $contact_email = $ContactEmail->email_address; } } if ($contact_email == '') { $contact_email = '*****@*****.**'; } if ($status == "Accept") { $email_template = new EmailTemplate("ofuz_inv_accept_confirmation"); } $do_user_rel = new UserRelations(); $invoice_url = $GLOBALS['cfg_ofuz_site_https_base'] . 'inv/' . $do_user_rel->encrypt($idinvoice) . '/' . $do_user_rel->encrypt($do_inv->idcontact); //$email_template->setSubject(_("Invoice #").$inv_num.' '.$inv_desc." "._("has been accepted by")." ".$contact_name); $email_template->setSenderName($contact_name); $email_template->setSenderEmail($contact_email); $signature = $inv_address; $email_data = array('name' => $contact_name, 'contact' => $contact_name, 'description' => $inv_desc, 'signature' => $signature, 'amount' => $total_due, 'num' => $inv_num, 'invoice_url' => $invoice_url, 'address' => $inv_address); $emailer = new Radria_Emailer(); $emailer->setEmailTemplate($email_template); $emailer->mergeArray($email_data); $emailer->addTo($do_inv_user->email); $emailer->send(); }
<?php /** Ofuz Open Source version is released under the GNU Affero General Public License, please read the full license at: http://www.gnu.org/licenses/agpl-3.0.html **/ // Copyright 2008 - 2010 all rights reserved, SQLFusion LLC, info@sqlfusion.com /** Ofuz Open Source version is released under the GNU Affero General Public License, please read the full license at: http://www.gnu.org/licenses/agpl-3.0.html **/ $password = $fields["password"]; if ($password != '') { $do_user_rel = new UserRelations(); $enc_password = $do_user_rel->encrypt($password); $fields["password"] = $enc_password; $this->updateParam("fields", $fields); }
if ($do_other_due_inv->getNumRows()) { ?> <div class="left_menu_header"> <div class="left_menu_header_content"><?php echo _('Other invoice due'); ?> </div> </div> <div class="left_menu"> <div class="left_menu_content"> <table width="100%"> <?php $do_user_rel = new UserRelations(); while ($do_other_due_inv->next()) { $invoice_url = ""; $invoice_url = $GLOBALS['cfg_ofuz_site_https_base'] . 'inv/' . $do_user_rel->encrypt($do_other_due_inv->idinvoice) . '/' . $do_user_rel->encrypt($do_other_due_inv->idcontact); $due_inv_link = $do_other_due_inv->num . " - " . $do_other_due_inv->datecreated . " - " . $_SESSION['do_invoice']->viewAmount($do_other_due_inv->amt_due); echo '<a href="' . $invoice_url . '">' . $due_inv_link . '</a>'; echo '<br />'; } ?> </table> </div> </div> <div class="left_menu_footer"></div><br /><br /> <?php } ?> </td><td class="layout_rcolumn"> <div class="contentfull">
include_once "class/OfuzApiMethods.class.php"; include_once "class/OfuzApiClient.class.php"; $api_key = 'f1976041736ccb95fbb322e1e5c07cbf'; // replace this with your API key $user = new User(); $iduser = $user->validateAPIKey($api_key); $idcontact = $_SESSION['do_User']->idcontact; //check for invoice already generated but not paid, if yes redirect to payment page if (!empty($idcontact)) { $invoice = new Invoice(); $idinvoice = $invoice->getContactInvoiceDetailsForPlanUpgrade($idcontact, $iduser); //echo "idinvoice: ".$idinvoice;exit(); if ($idinvoice != '0') { $do_api_user_rel = new UserRelations(); //$pay_url = 'http://ofuz.localhost/pay/'.$do_api_user_rel->encrypt($idinvoice).'/'.$do_api_user_rel->encrypt($idcontact); $pay_url = $GLOBALS['cfg_ofuz_site_https_base'] . 'pay/' . $do_api_user_rel->encrypt($idinvoice) . '/' . $do_api_user_rel->encrypt($idcontact); @header("location:{$pay_url}"); exit; } } $do_ofuz = new OfuzApiClient($api_key, 'php'); // $iduser = $do_ofuz->setAuth($api_key); // $do_ofuz->format = "php";// json,xml,php $do_ofuz->firstname = $_SESSION['do_User']->firstname; $do_ofuz->lastname = $_SESSION['do_User']->lastname; $response = $do_ofuz->search_contact(); $response = unserialize($response); //echo'<pre>';print_r($response);echo'</pre>'; if ($response[stat] == 'fail') { $do_ofuz->firstname = $_SESSION['do_User']->firstname; $do_ofuz->lastname = $_SESSION['do_User']->lastname;
function upgrade_plan_add_invoice() { $add_call_back_url = false; $do_contact_invoice = new Contact(); $do_api_invoice = new Invoice(); $do_api_invoice->addNew(); $do_contact_invoice->setSqlViewName($_SESSION["do_User"]->iduser); // set the sqlview name $do_api_invoice->idcontact = $this->idcontact; $do_api_invoice->iduser = $this->iduser; $do_api_invoice->status = $this->type; // could be status $do_api_invoice->num = $do_api_invoice->getUniqueInvoiceNum($this->iduser); $do_api_invoice->datecreated = date("Y-m-d"); $do_api_invoice->due_date = $this->due_date; $do_api_invoice->invoice_address = $do_contact_invoice->ajaxGetInvoiceAddress($this->idcontact); $do_api_invoice->invoice_term = $this->invoice_term; $do_api_invoice->invoice_note = $this->invoice_note; $do_api_invoice->description = $this->description; $do_contact_invoice->getId($this->idcontact); $do_api_invoice->idcompany = $do_contact_invoice->idcompany; $do_api_invoice->amt_due = $this->amt_due; $do_api_invoice->sub_total = $this->sub_total; $do_api_invoice->net_total = $this->net_total; $do_api_invoice->discount = $this->discount; $do_api_invoice->add(); $idinvoice = $do_api_invoice->getPrimaryKeyValue(); /** * Will Add an entry to the Invoice line table * */ if ($_SESSION["upgrade"]) { $do_invoice_line = new InvoiceLine(); $do_invoice_line->idinvoice = $idinvoice; $do_invoice_line->item = 'User Plan Upgrade'; $do_invoice_line->price = $this->amt_due; $do_invoice_line->qty = 1; $do_invoice_line->total = $this->amt_due; $do_invoice_line->description = $this->description; $do_invoice_line->add(); } //add to table invoice call back for trail users $url = $this->url; $next_url = $this->next_url; $invoice_call_back = new InvoiceCallback(); $invoice_call_back->addCallBackUrl($idinvoice, $url, $next_url); /*if($add_call_back_url){ $do_api_inv_call_back = new InvoiceCallback(); $callback = $do_api_inv_call_back->addCallBackUrl($idinvoice,$this->callback_url,$this->next_url); }*/ $do_api_user_rel = new UserRelations(); //$inv_url = $GLOBALS['cfg_ofuz_site_https_base'].'inv/'.$do_api_user_rel->encrypt($idinvoice).'/'.$do_api_user_rel->encrypt($this->idcontact); $pay_url = $GLOBALS['cfg_ofuz_site_https_base'] . 'pay/' . $do_api_user_rel->encrypt($idinvoice) . '/' . $do_api_user_rel->encrypt($this->idcontact); //$inv_url = 'http://ofuz.localhost/inv/'.$do_api_user_rel->encrypt($idinvoice).'/'.$do_api_user_rel->encrypt($this->idcontact); //$pay_url = 'http://ofuz.localhost/pay/'.$do_api_user_rel->encrypt($idinvoice).'/'.$do_api_user_rel->encrypt($this->idcontact); return $pay_url; }
/** * Event method to set the Identification after Twitter login and user details * verification * @param $evtcl -- Object */ function eventCheckIdentificationOnTwLogin(EventControler $evtcl) { setcookie('ofuz', '1', time() + 25920000); if ($evtcl->tw_user_id && $evtcl->tw_user_id != '' && $evtcl->tw_screen_name && $evtcl->tw_screen_name != '' && $evtcl->tw_token && $evtcl->tw_token != '') { if (strlen($evtcl->password_field) > 0) { $password_field = $evtcl->password_field; $this->setPasswordField($evtcl->password_field); } else { $password_field = $this->getPasswordField(); } if (strlen($evtcl->username_field) > 0) { $username_field = $evtcl->username_field; $this->setUsernameField($evtcl->username_field); } else { $username_field = $this->getUsernameField(); } $fields = $evtcl->fields; $auth_username = $fields[$username_field]; $auth_password = $fields[$password_field]; // Changes made to encrypt the password before looking in the DB $do_user_rel = new UserRelations(); $auth_password = $do_user_rel->encrypt($auth_password); $this->query("select * from `" . $this->table . "` \n where `username`='" . $this->quote($auth_username) . "' \n and `password`='" . $this->quote($auth_password) . "'"); if ($this->getNumrows() == 1) { if ($this->status == 'active') { $this->query("INSERT INTO twitter_account (iduser, tw_user_id, tw_screen_name, tw_token) VALUES (" . $this->iduser . ",'" . $evtcl->tw_user_id . "','" . $evtcl->tw_screen_name . "','" . $evtcl->tw_token . "')"); $this->setSessionVariable(); $do_login_audit = new LoginAudit(); $do_login_audit->do_login_audit('Twitter'); $evtcl->setUrlNext($evtcl->goto); } else { $err_disp = new Display($evtcl->errPage); $msg = _("Your account is not currently active, contact our tech support at " . $GLOBALS['cfg_ofuz_email_support']); $_SESSION['crdmsg'] = $msg; $err_disp->addParam("message", $msg); $eventControler->setDisplayNext($err_disp); } } else { $err_disp = new Display($evtcl->errPage); $msg = "Sorry! But there is no user found with the supplied details."; $err_disp->addParam("message", $msg); $evtcl->setDisplayNext($err_disp); } } else { $err_disp = new Display($evtcl->errPage); $msg = "Sorry! But seems like you are not connected to Twitter. Please connect first."; $err_disp->addParam("message", $msg); $evtcl->setDisplayNext($err_disp); } }