if ($act == 'check') { $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 */
?> </label> <?php if (LETHE_AUTH_MODE == 2 && PRO_MODE) { ?> <input type="number" onkeydown="validateNumber(event);" class="form-control autoWidth" id="org_max_shortcode" name="org_max_shortcode" value="<?php echo defined('set_org_max_shortcode') ? showIn(set_org_max_shortcode, 'input') : ''; ?> " size="5"> <span class="help-block">0 = <?php echo letheglobal_unlimited; ?> </span> <?php } else { echo '<div class="row"><div class="col-md-3">' . getMyLimits(calcSource(set_org_id, 'shortcode'), set_org_max_shortcode) . '</div></div>'; } ?> </div> <div class="form-group"> <label for="org_max_daily_limit"><?php echo sh('3Zb0MmV4bv') . organizations_daily_send_limit; ?> </label> <?php if (LETHE_AUTH_MODE == 2 && PRO_MODE) { ?> <input type="number" onkeydown="validateNumber(event);" class="form-control autoWidth" id="org_max_daily_limit" name="org_max_daily_limit" value="<?php echo defined('set_org_max_daily_limit') ? showIn(set_org_max_daily_limit, 'input') : ''; ?> " size="5">
$opUsers->free(); ?> </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">
die(errMod('Settings Could Not Be Loaded!', 'danger')); } else { $chkOrg = $myconn->prepare("SELECT ID,public_key FROM " . db_table_pref . "organizations WHERE public_key=?") or die(mysqli_error($myconn)); $chkOrg->bind_param('s', $_POST['lethe_oid']); $chkOrg->execute(); $chkOrg->store_result(); if ($chkOrg->num_rows == 0) { die(errMod('Settings Could Not Be Loaded!', 'danger')); } else { $srOrg = new Statement_Result($chkOrg); $chkOrg->fetch(); include_once LETHE_ADMIN . DIRECTORY_SEPARATOR . 'inc/org_set.php'; } } /* Source Limit */ $sourceLimit = calcSource($srOrg->Get('ID'), 'subscribers'); $opForm = $myconn->prepare("SELECT * FROM " . db_table_pref . "subscribe_forms WHERE form_id=? AND OID=" . $srOrg->Get('ID') . "") or die(mysqli_error($myconn)); $opForm->bind_param('s', $_POST['lethe_form']); $opForm->execute(); $opForm->store_result(); if ($opForm->num_rows == 0) { $errText = '<div class="alert alert-danger">' . letheglobal_subscribe_form_error . '</div>'; } else { $sr = new Statement_Result($opForm); $opForm->fetch(); /* Form Errors */ $formErrors = explode("[@]", $sr->Get('form_errors')); /* Stopped Subscription */ if (intval($sr->Get('subscription_stop')) != 0) { die(errMod(showIn($formErrors[3], 'page'), 'danger')); # Custom Error (Subscription Stopped)
<span class="badge"><?php echo calcSource(set_org_id, 'subscriber.blacklist'); ?> </span></li> <li class="list-group-item"><?php echo templates_templates; ?> <span class="badge"><?php echo calcSource(set_org_id, 'templates'); ?> </span></li> <li class="list-group-item"><?php echo organizations_short_codes; ?> <span class="badge"><?php echo calcSource(set_org_id, 'shortcode'); ?> </span></li> <li class="list-group-item"><?php echo organizations_daily_sent; ?> <span class="badge"><?php echo set_org_daily_sent; ?> </span></li> </ul> </div> <div class="col-xs-12 col-sm-12 col-md-5"> <h3><?php echo subscribers_precious_subscribers; ?>
} else { $errText = errMod(letheglobal_limit_exceeded, 'danger'); } } /* Edit Blacklist */ if (isset($_POST['editBlacklist'])) { if (isset($_POST['del'])) { $delRec = $myconn->prepare("DELETE FROM " . db_table_pref . "blacklist WHERE OID=" . set_org_id . " AND ID=?") or die(mysqli_error($myconn)); foreach ($_POST['del'] as $k => $v) { $v = !is_numeric($v) ? null : $v; $delRec->bind_param('i', $v); $delRec->execute(); } $delRec->close(); /* Init Limits */ $sourceLimit = calcSource(set_org_id, 'subscriber.blacklist'); $errText = errMod(letheglobal_updated_successfully, 'success'); } } ?> <?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>'; ?>
if (!permCheck($p)) { echo errMod(letheglobal_you_are_not_authorized_to_view_this_page, 'danger'); } else { $ID = !isset($_GET['ID']) || !is_numeric($_GET['ID']) ? 0 : intval($_GET['ID']); $TID = !isset($_GET['TID']) || !is_numeric($_GET['TID']) ? 0 : intval($_GET['TID']); /* Mod Settings */ $mod_confs = $lethe_modules[recursive_array_search('lethe.newsletter', $lethe_modules)]; $pg_title = $mod_confs['title']; $pg_nav_buts = ''; $errText = ''; /* Demo Check */ if (!isDemo('addNewsletter,editNewsletter')) { $errText = errMod(letheglobal_demo_mode_active, 'danger'); } /* Source Limit */ $sourceLimit = calcSource(set_org_id, 'newsletters'); /* Add Newsletter */ if (isset($_POST['addNewsletter'])) { # Clear Template Data $TID = 0; if (limitBlock($sourceLimit, set_org_max_newsletter)) { if (!isset($_POST['groups']) || !is_array($_POST['groups'])) { $errText .= '* ' . newsletter_please_choose_a_group . '<br>'; } if (!isset($_POST['launch_date']) || empty($_POST['launch_date'])) { $errText .= '* ' . newsletter_please_choose_a_launch_date . '<br>'; } else { if ((!isset($_POST['launch_hour']) || empty($_POST['launch_hour'])) && (!isset($_POST['launch_min']) || empty($_POST['launch_min']))) { $errText .= '* ' . newsletter_invalid_launch_date . '<br>'; } else { $genDate = $_POST['launch_date'] . ' ' . $_POST['launch_hour'] . ':' . $_POST['launch_min'] . ':00';
echo '<span class="text-success">' . subscribers_table_opened_successfully . '!</span><br>'; $recInv = !isset($_GET['recInv']) || !is_numeric($_GET['recInv']) ? 0 : intval($_GET['recInv']); $recBL = !isset($_GET['recBL']) || !is_numeric($_GET['recBL']) ? 0 : intval($_GET['recBL']); $recEx = !isset($_GET['recEx']) || !is_numeric($_GET['recEx']) ? 0 : intval($_GET['recEx']); $recSc = !isset($_GET['recSc']) || !is_numeric($_GET['recSc']) ? 0 : intval($_GET['recSc']); $pgGo = !isset($_GET['pgGo']) || !is_numeric($_GET['pgGo']) ? 1 : intval($_GET['pgGo']); $limit = $LETHE_EXP_LOAD_PAGE; $fTotal = mysqli_num_rows($myconnx->query("SELECT * FROM `" . $dbl_pref . $dbl_data['table'] . "`")); $fTotalPhase = ceil($fTotal / $limit); $dtStart = ($pgGo - 1) * $limit; $mtime = microtime(); $mtime = explode(" ", $mtime); $mtime = $mtime[1] + $mtime[0]; $endtime = $mtime; $totaltime = $endtime - $starttime; $sourceLimit = calcSource(set_org_id, 'subscribers'); $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
# | Lethe Newsletter & Mailing System | # | Copyright (c) Artlantis Design Studio 2014. All rights reserved. | # | Version 2.0 | # | Last modified 18.11.2014 | # | Email developer@artlantis.net | # | Web http://www.artlantis.net | # +------------------------------------------------------------------------+ $errText = ''; if (!isset($pgnt) || !$pgnt) { die; } /* Demo Check */ if (!isDemo('editCodes')) { $errText = errMod(letheglobal_demo_mode_active, 'danger'); } $sourceLimit = calcSource(set_org_id, 'shortcode'); $pg_nav_buts = ''; if (isset($_POST['editCodes'])) { /* Add New */ if (limitBlock($sourceLimit, set_org_max_shortcode)) { if (isset($_POST['new_code']) && !empty($_POST['new_code'])) { if (isset($_POST['new_code_val']) && !empty($_POST['new_code_val'])) { if (array_key_exists(strtoupper($_POST['new_code']), $LETHE_SYSTEM_SHORTCODES)) { $errText .= '* ' . organizations_short_code_has_defined_as_a_system_code . '<br>'; } if (cntData("SELECT ID FROM " . db_table_pref . "short_codes WHERE OID=" . set_org_id . " AND code_key='" . mysql_prep($_POST['new_code']) . "'") != 0) { $errText .= '* ' . organizations_short_code_already_exists . '<br>'; } if ($errText == '') { $addCode = $myconn->prepare("INSERT INTO " . db_table_pref . "short_codes SET OID=" . set_org_id . ", code_key=?, code_val=?") or die(mysqli_error($myconn)); $addCode->bind_param('ss', $_POST['new_code'], $_POST['new_code_val']);
if (!permCheck($p)) { echo errMod(letheglobal_you_are_not_authorized_to_view_this_page, 'danger'); } else { $ID = !isset($_GET['ID']) || !is_numeric($_GET['ID']) ? 0 : intval($_GET['ID']); /* Mod Settings */ include_once 'mod.common.php'; $mod_confs = $lethe_modules[recursive_array_search('lethe.autoresponder', $lethe_modules)]; $pg_title = $mod_confs['title']; $pg_nav_buts = ''; $errText = ''; /* Demo Check */ if (!isDemo('addAutoresponder,editAutoresponder')) { $errText = errMod(letheglobal_demo_mode_active, 'danger'); } /* Source Limit */ $sourceLimit = calcSource(set_org_id, 'autoresponder'); /* Default Values */ $ar_action = !isset($_POST['ar_action']) || !is_numeric($_POST['ar_action']) || $_POST['ar_action'] == 999 ? 999 : intval($_POST['ar_action']); $ar_time = 1; $ar_time_type = 'MINUTE'; $ar_start_date = date('Y-m-d H:i:s'); $ar_end_date = strtotime(date('Y-m-d H:i:s')); $ar_weeks = '1,1,1,1,1,1,1'; $ar_end = 0; /* Add Autoresponder */ if (isset($_POST['addAutoresponder'])) { if (limitBlock($sourceLimit, set_org_max_autoresponder)) { if (!isset($_POST['groups']) || !is_array($_POST['groups'])) { $errText .= '* ' . autoresponder_please_choose_a_group . '<br>'; } if (!isset($_POST['launch_date']) || empty($_POST['launch_date'])) {
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; }
if (!isset($_GET['ID']) || !is_numeric($_GET['ID'])) { $ID = 0; } else { $ID = intval($_GET['ID']); } /* Mod Settings */ $mod_confs = $lethe_modules[recursive_array_search('lethe.templates', $lethe_modules)]; $pg_title = $mod_confs['title']; $pg_nav_buts = ''; $errText = ''; /* Demo Check */ if (!isDemo('addTemplate,editTemplate')) { $errText = errMod(letheglobal_demo_mode_active, 'danger'); } /* Source Limit */ $sourceLimit = calcSource(set_org_id, 'templates'); /* Add Template */ if (isset($_POST['addTemplate'])) { if (limitBlock($sourceLimit, set_org_max_template)) { if (!isset($_POST['title']) || empty($_POST['title'])) { $errText .= '* ' . templates_please_enter_a_template_name . '<br>'; } if (!isset($_POST['details']) || empty($_POST['details'])) { $errText .= '* ' . templates_please_enter_template_details . '<br>'; } if (!isset($_POST['preview']) || !urlVal($_POST['preview'])) { $_POST['preview'] = ''; } if ($errText == '') { $addData = $myconn->prepare("INSERT INTO " . db_table_pref . "templates SET temp_name=?, temp_contents=?,temp_prev=?,temp_type='normal', OID=" . set_org_id . ", UID=" . LETHE_AUTH_ID . "") or die(mysqli_error($myconn)); $addData->bind_param('sss', $_POST['title'], $_POST['details'], $_POST['preview']);