$chkAPI = $myconn->prepare("SELECT ID FROM " . db_table_pref . "subscribers WHERE OID=" . $sr->Get('ID') . " AND subscriber_mail=?") or die(mysqli_error($myconn)); $chkAPI->bind_param('s', $lmail); $chkAPI->execute(); $chkAPI->store_result(); if ($chkAPI->num_rows == 0) { $chkAPI->close(); jsonRet(false, 'EMAIL_NOT_EXISTS'); } else { $chkAPI->close(); jsonRet(true, 'EMAIL_EXISTS'); } } else { if ($act == 'toblacklist') { /* Limit Controller */ $sourceLimit = calcSource($sr->Get('ID'), 'subscriber.blacklist'); if (!limitBlock($sourceLimit, $orgSets['set_org_max_blacklist'])) { jsonRet(false, 'BLACKLIST_LIMIT_EXCEEDED'); } $chkAPI = $myconn->prepare("SELECT ID FROM " . db_table_pref . "blacklist WHERE OID=" . $sr->Get('ID') . " AND email=?") or die(mysqli_error($myconn)); $chkAPI->bind_param('s', $lmail); $chkAPI->execute(); $chkAPI->store_result(); if ($chkAPI->num_rows == 0) { /* Add to Blacklist */ $addBL = $myconn->prepare("INSERT INTO " . db_table_pref . "blacklist SET OID=" . $sr->Get('ID') . ",ipAddr='0.0.0.0',reasons=3,email=?") or die(mysqli_error($myconn)); $addBL->bind_param('s', $lmail); $addBL->execute(); $addBL->close(); $chkAPI->close(); /* Remove From List */ $remMAIL = $myconn->prepare("DELETE FROM " . db_table_pref . "subscribers WHERE OID=" . $sr->Get('ID') . " AND subscriber_mail=?") or die(mysqli_error($myconn));
if ($opFieldsRs['field_required'] == 1) { $errText .= '* ' . showIn($opFieldsRs['field_error'], 'page') . '<br>'; } else { $_POST[$opFieldsRs['field_name']] = null; } } } $opFields->free(); /* Check Subscriber Existed */ /* Save Data */ if ($errText == '') { # No Error if ($saveMod) { #Subscribe /* Limit Control */ if (!limitBlock($sourceLimit, $LETHE_ORG_SETS['set_org_max_subscriber'])) { die(errMod(showIn($formErrors[3], 'page'), 'danger')); # Custom Error (Subscription Stopped for Limit Exceeded) } /* Saving */ //print_r($saveList); $ads = new lethe(); $ads->OID = $srOrg->Get('ID'); $ads->subscribeData = $saveList; if ($ads->addSubscriber()) { $subThank = showIn($sr->Get('form_success_text'), 'page'); $formSuccTxt = $sr->Get('form_success_url_text'); $formSuccURL = $sr->Get('form_success_url'); if (!empty($formSuccTxt) && !empty($formSuccURL)) { $subThank .= '<a href="' . showIn($sr->Get('form_success_url'), 'input') . '">' . showIn($sr->Get('form_success_url_text'), 'page') . '</a>'; if ($sr->Get('form_success_redir') && !isLogged()) {
?> </tbody> </table> <script type="text/javascript"> $(document).ready(function(){ $('.footable').footable(); }); </script> <!-- User List End --> <?php } else { if ($page_sub2 == 'add') { #Add $sourceLimit = calcSource(set_org_id, 'users'); if (!limitBlock($sourceLimit, set_org_max_user)) { $lethe->isSuccess = 1; } echo '<h1>' . $pg_title . '<span class="help-block"><span class="text-primary">' . organizations_add_user . '</span></span></h1><hr>' . $pg_nav_buts . $errText; echo '<div class="row"> <div class="col-md-3"><div class="form-group"><label>' . sh('pRP9MnRKno') . letheglobal_limits . '</label><span class="clearfix"></span>' . getMyLimits($sourceLimit, set_org_max_user) . '</div></div> </div>'; ?> <!-- User Add Start --> <?php if (!isset($lethe->isSuccess) || $lethe->isSuccess == 0) { ?> <form action="" method="POST" onsubmit="listbox_selectall('perm-sel-list', true)"> <div role="tabpanel"> <!-- Nav tabs -->
<?php echo '<h1>' . $pg_title . '<span class="help-block"><span class="text-primary">' . subscribers_blacklist . '</span></span></h1><hr>' . $pg_nav_buts . $errText; ?> <div class="form-group"> <?php echo '<div class="row"> <div class="col-md-3"><div class="form-group"><label>' . letheglobal_limits . '</label><span class="clearfix"></span>' . getMyLimits($sourceLimit, set_org_max_blacklist) . '</div></div> </div>'; ?> </div> <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> <?php if (limitBlock($sourceLimit, set_org_max_blacklist)) { ?> <div class="panel panel-info"> <div class="panel-heading" role="tab" id="headingOne"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="false" aria-controls="collapseOne"> <?php echo subscribers_add_new_record; ?> </a> </h4> </div> <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne"> <div class="panel-body"> <form method="POST" action=""> <div class="row">
echo '<h1>' . $pg_title . ' <span class="help-block text-primary">' . newsletter_add_campaign . '</span></h1><hr>' . $pg_nav_buts . $errText; echo '<div class="row"> <div class="col-md-3"><div class="form-group"><label>' . sh('pRP9MnRKno') . letheglobal_limits . '</label><span class="clearfix"></span>' . getMyLimits($sourceLimit, set_org_max_newsletter) . '</div></div> </div>'; /* Load Groups for All Sections */ $listGrps = array(); $opGroups = $myconn->query("SELECT \n\t\t\t\t\t\t\t\t\t\tSG.*,\n\t\t\t\t\t\t\t\t\t\t(SELECT COUNT(ID) FROM " . db_table_pref . "subscribers WHERE GID=SG.ID) AS sbr_cnt\n\t\t\t\t\t\t\t\t FROM \n\t\t\t\t\t\t\t\t\t\t" . db_table_pref . "subscriber_groups AS SG\n\t\t\t\t\t\t\t\t WHERE \n\t\t\t\t\t\t\t\t\t\tOID=" . set_org_id . " \n\t\t\t\t\t\t\t\t AND\n\t\t\t\t\t\t\t\t\t\tisUnsubscribe=0\n\n\t\t\t\t\t\t\t\t\t\t" . (LETHE_AUTH_VIEW_TYPE ? ' AND UID=' . LETHE_AUTH_ID . '' : '') . "\n\t\t\t\t\t\t\t ORDER BY\n\t\t\t\t\t\t\t\t\t\tgroup_name\n\t\t\t\t\t\t\t\t ASC\n\t\t\t\t\t\t\t\t") or die(mysqli_error($myconn)); while ($opGroupsRs = $opGroups->fetch_assoc()) { $listGrps[] = $opGroupsRs; } $opGroups->free(); ?> <!-- Newsletter Add Start --> <?php if (limitBlock($sourceLimit, set_org_max_newsletter)) { ?> <script> var customMCEchar='<?php echo LOADED_LANG; ?> '; var miniPAN=true; </script> <script src="Scripts/tinymce/tinymce.min.js"></script> <script src="Scripts/tinymce/tinymce.custom.js"></script> <script src="Scripts/leUpload.js"></script> <link href="css/jquery-ui.min.css" rel="stylesheet" type="text/css"> <link href="css/jquery-ui.theme.min.css" rel="stylesheet" type="text/css"> <form name="newNewsletter" id="newNewsletter" action="" method="POST">
die(errMod(letheglobal_demo_mode_active, 'danger')); } if ($pos == 'savefieldorders') { die(errMod(letheglobal_demo_mode_active, 'danger')); } if ($pos == 'updateFields') { die(errMod(letheglobal_demo_mode_active, 'danger')); } if ($pos == 'savesettings0') { die(errMod(letheglobal_demo_mode_active, 'danger')); } } /* Create Form Draft */ if ($pos == 'createdraft') { $sourceLimit = calcSource(set_org_id, 'subscriber.forms'); if (limitBlock($sourceLimit, set_org_max_subscribe_form)) { # Limit Control /* Form Errors */ $formErrors = array(); foreach ($LETHE_SUBSCRIBE_ERRORS as $k => $v) { $formErrors[] = $v[1]; } $formErrors = implode("[@]", $formErrors); if (isset($_GET['draftPos']) && is_numeric($_GET['draftPos']) && $_GET['draftPos'] == 0) { # Form Draft $addDraft = $myconn->query("INSERT INTO " . db_table_pref . "subscribe_forms SET\n\t\t\t\t\t\t\t\t\t\t\tOID=" . set_org_id . ",\n\t\t\t\t\t\t\t\t\t\t\tform_name='Draft Form',\n\t\t\t\t\t\t\t\t\t\t\tform_id='LetheForm_" . substr(md5(time() . rand() . uniqid(true)), 0, 7) . "',\n\t\t\t\t\t\t\t\t\t\t\tform_type=0,\n\t\t\t\t\t\t\t\t\t\t\tisDraft=1,\n\t\t\t\t\t\t\t\t\t\t\tUID=" . LETHE_AUTH_ID . ",\n\t\t\t\t\t\t\t\t\t\t\tform_errors='" . mysql_prep($formErrors) . "'\n\t\t\t\t\t\t\t\t\t\t") or die(mysqli_error($myconn)); $formID = $myconn->insert_id; $addStatic = $myconn->query("INSERT INTO " . db_table_pref . "subscribe_form_fields (OID,FID,field_label,field_name,field_type,field_required,field_placeholder,sorting,field_static,field_error,field_save) VALUES\n\t\t\t\t\t\t\t\t\t\t(" . set_org_id . "," . $formID . ",'E-Mail','LetheForm_Mail','email',1,'E-Mail',0,1,'Invalid E-Mail Address','subscriber_mail'),\n\t\t\t\t\t\t\t\t\t\t(" . set_org_id . "," . $formID . ",'Save','LetheForm_Save','submit',0,'',1,1,'','')\n\t\t\t\t\t\t\t\t\t\t") or die(mysqli_error($myconn)); echo errMod(letheglobal_recorded_successfully . ' <a href="?p=subscribers/forms/add" class="alert-link">' . subscribers_click_to_continue . '</a>', 'success'); } else { if (isset($_GET['draftPos']) && is_numeric($_GET['draftPos']) && $_GET['draftPos'] == 1) {
$sourceCntTemp = $sourceLimit; /* Prepares */ $imp = $myconn->prepare("INSERT INTO \n\t\t\t\t\t\t\t\t\t\t\t\t" . db_table_pref . "subscribers \n\t\t\t\t\t\t\t\t\t\t SET\n\t\t\t\t\t\t\t\t\t\t\t\tOID=" . set_org_id . ",\n\t\t\t\t\t\t\t\t\t\t\t\tGID=" . $impGrp . ",\n\t\t\t\t\t\t\t\t\t\t\t\tsubscriber_name=?,\n\t\t\t\t\t\t\t\t\t\t\t\tsubscriber_mail=?,\n\t\t\t\t\t\t\t\t\t\t\t\tsubscriber_active=" . $isActive . ",\n\t\t\t\t\t\t\t\t\t\t\t\tsubscriber_verify=" . $isVerfiy . ",\n\t\t\t\t\t\t\t\t\t\t\t\tsubscriber_key=?,\n\t\t\t\t\t\t\t\t\t\t\t\tsubscriber_full_data=?,\n\t\t\t\t\t\t\t\t\t\t\t\tsubscriber_verify_key=?\n\t\t\t\t\t\t\t\t\t\t ") or die(mysqli_error($myconn)); /* Mail Checker */ $mailChk = $myconn->prepare("SELECT ID FROM " . db_table_pref . "subscribers WHERE OID=" . set_org_id . " AND subscriber_mail=?") or die(mysqli_error($myconn)); $mailBLChk = $myconn->prepare("SELECT ID FROM " . db_table_pref . "blacklist WHERE OID=" . set_org_id . " AND email=?") or die(mysqli_error($myconn)); $fetchData = $myconnx->query("SELECT * FROM `" . $dbl_pref . $dbl_data['table'] . "` LIMIT {$dtStart},{$limit}") or die(mysqli_error($myconn)); while ($fetchDataRs = $fetchData->fetch_assoc()) { $fname = isset($fetchDataRs[$dbl_data['field_name']]) && $fetchDataRs[$dbl_data['field_name']] != '' ? $fetchDataRs[$dbl_data['field_name']] : ''; $fname2 = isset($fetchDataRs[$dbl_data['field_name2']]) && $fetchDataRs[$dbl_data['field_name2']] != '' ? $fetchDataRs[$dbl_data['field_name2']] : ''; $sub_mail = isset($fetchDataRs[$dbl_data['field_email']]) && $fetchDataRs[$dbl_data['field_email']] != '' ? $fetchDataRs[$dbl_data['field_email']] : 'NULL'; $sub_name = $fname . ($fname != '' ? ' ' . $fname2 : ''); $fullData = array(); $jsonObject = null; # Limit Control if (!limitBlock($sourceCntTemp, set_org_max_subscriber)) { $progPer = 100; $limitExceeded = letheglobal_limit_exceeded; break; } /* Invalid Check */ if (!mailVal($sub_mail)) { $recInv++; } else { /* Check Blacklist */ $mailBLChk->bind_param('s', $sub_mail); $mailBLChk->execute(); $mailBLChk->store_result(); if ($mailBLChk->num_rows == 0) { /* Check Data */ $mailChk->bind_param('s', $sub_mail);
<input type="hidden" name="code_key_<?php echo $opCodesRs['ID']; ?> " value="<?php echo $opCodesRs['code_key']; ?> "> <hr class="visible-xs"> </div> <?php } $opCodes->free(); ?> <?php if (limitBlock($sourceLimit, set_org_max_shortcode)) { ?> <h3><?php echo organizations_add_new_code; ?> </h3> <hr> <div class="row"> <div class="col-md-4"><div class="form-group"><input type="text" onblur="shortCodeMaker(this.id);" value="" class="form-control" name="new_code" id="new_code" placeholder="<?php echo organizations_new_code; ?> "></div></div> <div class="col-md-8"><div class="form-group"><input type="text" value="" class="form-control" name="new_code_val" id="new_code_val" placeholder="<?php echo organizations_new_code_value; ?> "></div></div>
echo '<h1>' . $pg_title . ' <span class="help-block text-primary">' . autoresponder_add_campaign . '</span></h1><hr>' . $pg_nav_buts . $errText; echo '<div class="row"> <div class="col-md-3"><div class="form-group"><label>' . sh('pRP9MnRKno') . letheglobal_limits . '</label><span class="clearfix"></span>' . getMyLimits($sourceLimit, set_org_max_autoresponder) . '</div></div> </div>'; /* Load Groups for All Sections */ $listGrps = array(); $opGroups = $myconn->query("SELECT \n\t\t\t\t\t\t\t\t\t\tSG.*,\n\t\t\t\t\t\t\t\t\t\t(SELECT COUNT(ID) FROM " . db_table_pref . "subscribers WHERE GID=SG.ID) AS sbr_cnt\n\t\t\t\t\t\t\t\t FROM \n\t\t\t\t\t\t\t\t\t\t" . db_table_pref . "subscriber_groups AS SG\n\t\t\t\t\t\t\t\t WHERE \n\t\t\t\t\t\t\t\t\t\tOID=" . set_org_id . " \n\t\t\t\t\t\t\t\t AND\n\t\t\t\t\t\t\t\t\t\tisUnsubscribe=0\n\n\t\t\t\t\t\t\t\t\t\t" . (LETHE_AUTH_VIEW_TYPE ? ' AND UID=' . LETHE_AUTH_ID . '' : '') . "\n\t\t\t\t\t\t\t ORDER BY\n\t\t\t\t\t\t\t\t\t\tgroup_name\n\t\t\t\t\t\t\t\t ASC\n\t\t\t\t\t\t\t\t") or die(mysqli_error($myconn)); while ($opGroupsRs = $opGroups->fetch_assoc()) { $listGrps[] = $opGroupsRs; } $opGroups->free(); ?> <!-- Autoresponder Add Start --> <?php if (limitBlock($sourceLimit, set_org_max_autoresponder)) { ?> <script> var customMCEchar='<?php echo LOADED_LANG; ?> '; var miniPAN=true; </script> <script src="Scripts/tinymce/tinymce.min.js"></script> <script src="Scripts/tinymce/tinymce.custom.js"></script> <script src="Scripts/leUpload.js"></script> <link href="css/jquery-ui.min.css" rel="stylesheet" type="text/css"> <link href="css/jquery-ui.theme.min.css" rel="stylesheet" type="text/css"> <form name="newAutoresponder" id="newAutoresponder" action="" method="POST">
public function addUser() { global $myconn; if (!isset($_POST['usr_name']) || empty($_POST['usr_name'])) { $this->errPrint .= '* ' . letheglobal_please_enter_a_name . '<br>'; } if (!isset($_POST['usr_mail']) || !mailVal($_POST['usr_mail'])) { $this->errPrint .= '* ' . letheglobal_invalid_e_mail_address . '<br>'; } else { if (cntData("SELECT ID,mail FROM " . db_table_pref . "users WHERE mail='" . mysql_prep($_POST['usr_mail']) . "'") != 0) { $this->errPrint .= '* ' . letheglobal_e_mail_already_exists . '<br>'; } } if (!isset($_POST['usr_pass']) || empty($_POST['usr_pass'])) { $this->errPrint .= '* ' . letheglobal_please_enter_password . '<br>'; } else { $passLenth = isToo($_POST['usr_pass'], letheglobal_password . ' ', 5, 30); if ($passLenth != '') { $this->errPrint .= '* ' . $passLenth . '<br>'; } else { if (!isset($_POST['usr_pass2']) || $_POST['usr_pass2'] != $_POST['usr_pass']) { $this->errPrint .= '* ' . letheglobal_passwords_mismatch . '<br>'; } } } if ($this->isMaster == 0) { # Organization User //if(!isset($_POST['user_daily_limit']) || !is_numeric($_POST['user_daily_limit'])){$this->errPrint.='* '. organizations_please_enter_a_daily_sending_limit .'<br>';} if (!isset($_POST['perm-sel-list']) || empty($_POST['perm-sel-list'])) { $this->errPrint .= '* ' . organizations_please_choose_access_pages . '<br>'; } if (!isset($_POST['user_auth_mode']) || !is_numeric($_POST['user_auth_mode'])) { $this->errPrint .= '* ' . organizations_select_a_management_type . '<br>'; } else { /* CSRF Auth Protection */ if (intval($_POST['user_auth_mode']) > 1) { $this->auth_mode = 0; } else { $this->auth_mode = intval($_POST['user_auth_mode']); } /* Make Primary For New Organization */ if (intval($_POST['user_auth_mode']) == 1) { if (cntData("SELECT ID FROM " . db_table_pref . "users WHERE OID=" . $this->OID . " AND isPrimary=1") == 0) { $this->isPrimary = 1; } else { $this->isPrimary = 0; } } /* Check Limit */ $sourceLimit = calcSource($this->OID, 'users'); if (!limitBlock($sourceLimit, set_org_max_user)) { $this->errPrint .= '* ' . letheglobal_limit_exceeded . '<br>'; } } } else { $_POST['user_daily_limit'] = 0; } if ($this->errPrint == '') { $privateKey = encr(md5(rand() . uniqid('youaremylethe', true) . sha1(time()))); $publicKey = encr(uniqid('youaremylethe', true) . time() . rand()); $usrPass = encr($_POST['usr_pass']); $LPRE = $myconn->prepare("INSERT INTO \n\t\t\t\t\t\t\t\t\t\t\t\t\t" . db_table_pref . "users \n\t\t\t\t\t\t\t\t\t\t\t SET \n\t\t\t\t\t\t\t\t\t\t\t\t\tOID=" . $this->OID . ",\n\t\t\t\t\t\t\t\t\t\t\t\t\treal_name=?,\n\t\t\t\t\t\t\t\t\t\t\t\t\tmail=?,\n\t\t\t\t\t\t\t\t\t\t\t\t\tpass=?,\n\t\t\t\t\t\t\t\t\t\t\t\t\tauth_mode=" . $this->auth_mode . ",\n\t\t\t\t\t\t\t\t\t\t\t\t\tisActive=1,\n\t\t\t\t\t\t\t\t\t\t\t\t\tisPrimary=" . $this->isPrimary . ",\n\t\t\t\t\t\t\t\t\t\t\t\t\tprivate_key='" . $privateKey . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\tpublic_key='" . $publicKey . "'\n\t\t\t\t\t\t\t\t\t") or die(mysqli_error($myconn)); $LPRE->bind_param('sss', $_POST['usr_name'], $_POST['usr_mail'], $usrPass); $LPRE->execute(); $LPRE->close(); $usrID = $myconn->insert_id; if ($this->isMaster == 0) { # Organization User /* Add Allowed Pages */ $addPerm = $myconn->prepare("INSERT INTO " . db_table_pref . "user_permissions SET OID=" . $this->OID . ", UID=?, perm=?") or die(mysqli_error($myconn)); foreach ($_POST['perm-sel-list'] as $k => $v) { $pg = str_replace('?p=', '', $v); $addPerm->bind_param('is', $usrID, $pg); $addPerm->execute(); } $addPerm->close(); } $this->errPrint = errMod(letheglobal_recorded_successfully . '!', 'success'); $this->isSuccess = 1; if (!$this->onInstall) { unset($_POST); } } else { $this->errPrint = errMod($this->errPrint, 'danger'); } return $this->errPrint; }
</button> </div> <?php } else { echo errMod(subscribers_two_or_more_groups_required, 'danger'); } ?> </form> </div> </div> </div> <form method="POST" action=""> <?php if (limitBlock($sourceLimit, set_org_max_subscriber_group)) { ?> <div class="panel panel-warning"> <div class="panel-heading" role="tab" id="headingThree"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree"> <?php echo subscribers_add_new_group; ?> </a> </h4> </div> <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree"> <div class="panel-body"> <div class="row"> <div class="col-md-12"><div class="form-group"><input type="text" value="" class="form-control" name="new_group" id="new_group" placeholder="<?php
?> </div> </div> <!-- Template List End --> <?php } else { if ($page_sub == 'add') { echo '<h1>' . $pg_title . '<span class="help-block"><span class="text-primary">' . letheglobal_add . '</span></span></h1><hr>' . $pg_nav_buts . $errText; echo '<div class="row"> <div class="col-md-3"><div class="form-group"><label>' . sh('pRP9MnRKno') . letheglobal_limits . '</label><span class="clearfix"></span>' . getMyLimits($sourceLimit, set_org_max_template) . '</div></div> </div>'; ?> <!-- Template Add Start --> <?php if (limitBlock($sourceLimit, set_org_max_template)) { ?> <script> var customMCEchar='<?php echo LOADED_LANG; ?> '; var miniPAN=true; </script> <script src="Scripts/tinymce/tinymce.min.js"></script> <script src="Scripts/tinymce/tinymce.custom.js"></script> <script src="Scripts/leUpload.js"></script> <form method="POST" action=""> <div class="form-group">