Esempio n. 1
0
function getActiveFraudModule()
{
    global $CONFIG;
    $result = select_query("tblfraud", "fraud", array("setting" => "Enable", "value" => "on"));
    $data = mysql_fetch_array($result);
    $fraud = $data['fraud'];
    $orderid = $_SESSION['orderdetails']['OrderID'];
    if ($CONFIG['SkipFraudForExisting']) {
        $result = select_query("tblorders", "COUNT(*)", array("status" => "Active", "userid" => $_SESSION['uid']));
        $data = mysql_fetch_array($result);
        if ($data[0]) {
            $fraudmodule = "";
            logActivity("Order ID " . $orderid . " Skipped Fraud Check due to Already Active Orders");
        }
    }
    $hookresponses = run_hook("RunFraudCheck", array("orderid" => $orderid, "userid" => $_SESSION['uid']));
    foreach ($hookresponses as $hookresponse) {
        if ($hookresponse) {
            $fraud = "";
            logActivity("Order ID " . $orderid . " Skipped Fraud Check due to Custom Hook");
            continue;
        }
    }
    return $fraud;
}
Esempio n. 2
0
function editor_page_admin_CSS()
{
    //Allow module to manipulate css
    $page_theme = THEME;
    run_hook('site_theme', array(&$page_theme));
    global $lang;
    ?>
	<form method="post" action="">
		<label class="kop2" for="cont1"><?php 
    echo $lang['editor']['content_css'];
    ?>
</label>
		<br />
		<textarea name="cont1" id="cont1" cols="90" rows="20"><?php 
    echo read_style($page_theme);
    ?>
</textarea>
		<br />
		<input type="submit" name="Submit" value="<?php 
    echo $lang['general']['save'];
    ?>
" />
		<input type="button" name="Cancel" value="<?php 
    echo $lang['general']['cancel'];
    ?>
" onclick="javascript: window.location='admin.php?module=editor';" />
	</form>
<?php 
    //Save style.
    if (isset($_POST['Submit'])) {
        $cont1 = $_POST['cont1'];
        save_style($page_theme, $cont1);
        redirect('admin.php?module=editor', 0);
    }
}
Esempio n. 3
0
function pla_rdelete($ldapserver, $dn)
{
    $children = $ldapserver->getContainerContents($dn);
    if (!is_array($children) || count($children) == 0) {
        printf('<nobr>' . _('Deleting %s') . '...', htmlspecialchars($dn));
        flush();
        if (run_hook('pre_entry_delete', array('server_id' => $ldapserver->server_id, 'dn' => $dn))) {
            if ($ldapserver->delete($dn)) {
                run_hook('post_entry_delete', array('server_id' => $ldapserver->server_id, 'dn' => $dn));
                printf(' <span style="color:green">%s</span></nobr><br />', _('Success'));
                return true;
            } else {
                pla_error(sprintf(_('Failed to delete entry %s'), htmlspecialchars($dn)), $ldapserver->error(), $ldapserver->errno());
            }
        }
    } else {
        foreach ($children as $child_dn) {
            pla_rdelete($ldapserver, $child_dn);
        }
        printf('<nobr>' . _('Deleting %s') . '...', htmlspecialchars($dn));
        flush();
        if (run_hook('pre_entry_delete', array('server_id' => $ldapserver->server_id, 'dn' => $dn))) {
            if ($ldapserver->delete($dn)) {
                run_hook('post_entry_delete', array('server_id' => $ldapserver->server_id, 'dn' => $dn));
                printf(' <span style="color:green">%s</span></nobr><br />', _('Success'));
                return true;
            } else {
                pla_error(sprintf(_('Failed to delete entry %s'), htmlspecialchars($dn)), $ldapserver->error(), $ldapserver->errno());
            }
        }
    }
}
Esempio n. 4
0
function run_validate_hook(&$validate, $hook_name, $args)
{
    $hookerrors = run_hook($hook_name, $args);
    $errormessage = "";
    if (count($hookerrors)) {
        foreach ($hookerrors as $hookerrors2) {
            if (is_array($hookerrors2)) {
                $validate->addErrors($hookerrors2);
                continue;
            }
            $validate->addError($hookerrors2);
        }
    }
}
Esempio n. 5
0
/**
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
function affiliateActivate($userid)
{
    global $CONFIG;
    $result = select_query("tblclients", "currency", array("id" => $userid));
    $data = mysql_fetch_array($result);
    $clientcurrency = $data['currency'];
    $bonusdeposit = convertCurrency($CONFIG['AffiliateBonusDeposit'], 1, $clientcurrency);
    $result = select_query("tblaffiliates", "id", array("clientid" => $userid));
    $data = mysql_fetch_array($result);
    $affiliateid = $data['id'];
    if (!$affiliateid) {
        $affiliateid = insert_query("tblaffiliates", array("date" => "now()", "clientid" => $userid, "balance" => $bonusdeposit));
    }
    logActivity("Activated Affiliate Account - Affiliate ID: " . $affiliateid . " - User ID: " . $userid, $userid);
    run_hook("AffiliateActivation", array("affid" => $affiliateid, "userid" => $userid));
}
Esempio n. 6
0
function copy_dn($ldapserver_src, $ldapserver_dst, $dn_src, $dn_dst)
{
    if (DEBUG_ENABLED) {
        debug_log('copy_dn: Entered with (%s,%s,%s,%s)', 17, $ldapserver_src->server_id, $ldapserver_dst->server_id, $dn_src, $dn_dst);
    }
    $new_entry = $ldapserver_src->getDNAttrs($dn_src);
    # modify the prefix-value (ie "bob" in cn=bob) to match the destination DN's value.
    $rdn_attr = substr($dn_dst, 0, strpos($dn_dst, '='));
    $rdn_value = get_rdn($dn_dst);
    $rdn_value = substr($rdn_value, strpos($rdn_value, '=') + 1);
    $new_entry[$rdn_attr] = $rdn_value;
    # don't need a dn attribute in the new entry
    unset($new_entry['dn']);
    # Check the user-defined custom call back first
    if (run_hook('pre_entry_create', array('server_id' => $ldapserver_dst->server_id, 'dn' => $dn_dst, 'attrs' => $new_entry))) {
        $add_result = $ldapserver_dst->add($dn_dst, $new_entry);
        if (!$add_result) {
            run_hook('post_entry_create', array('server_id' => $ldapserver_dst->server_id, 'dn' => $dn_dst, 'attrs' => $new_entry));
            echo '</small><br /><br />';
            pla_error(_('Failed to copy DN: ') . $dn_dst, $ldapserver_dst->error(), $ldapserver_dst->errno());
        }
        return $add_result;
    } else {
        return false;
    }
}
Esempio n. 7
0
    define('MODULE_SETTINGS_DIR', 'data/settings/modules/' . $_GET['module']);
}
if (file_exists(PAGE_DIR)) {
    $homepage = read_dir_contents(PAGE_DIR, 'files');
    if ($homepage != false) {
        sort($homepage, SORT_NUMERIC);
        $homepage = get_page_seoname($homepage[0]);
    } else {
        $homepage = '404';
    }
    $page_url_prefix = '?file=';
    run_hook('page_url_prefix', array(&$page_url_prefix));
    define('PAGE_URL_PREFIX', $page_url_prefix);
    unset($page_url_prefix);
    $homepage = SITE_URI . '/' . PAGE_URL_PREFIX . $homepage;
    run_hook('const_home_page', array(&$homepage));
    define('HOME_PAGE', $homepage);
    unset($homepage);
}
//Some GET-variables for general use.
if (isset($_GET['var1'])) {
    $var1 = $_GET['var1'];
}
if (isset($_GET['var2'])) {
    $var2 = $_GET['var2'];
}
if (isset($_GET['var3'])) {
    $var3 = $_GET['var3'];
}
if (isset($_GET['var4'])) {
    $var4 = $_GET['var4'];
Esempio n. 8
0
function disableAutoRenew($domainid)
{
    update_query("tbldomains", array("donotrenew" => "on"), array("id" => $domainid));
    $domainname = get_query_val("tbldomains", "domain", array("id" => $domainid));
    if ($_SESSION['adminid']) {
        logActivity("Admin Disabled Domain Auto Renew - Domain ID: " . $domainid . " - Domain: " . $domainname);
    } else {
        logActivity("Client Disabled Domain Auto Renew - Domain ID: " . $domainid . " - Domain: " . $domainname);
    }
    $result = select_query("tblinvoiceitems", "tblinvoiceitems.id,tblinvoiceitems.invoiceid", array("type" => "Domain", "relid" => $domainid, "status" => "Unpaid", "tblinvoices.userid" => $_SESSION['uid']), "", "", "", "tblinvoices ON tblinvoices.id=tblinvoiceitems.invoiceid");
    while ($data = mysql_fetch_array($result)) {
        $itemid = $data['id'];
        $invoiceid = $data['invoiceid'];
        $result2 = select_query("tblinvoiceitems", "COUNT(*)", array("invoiceid" => $invoiceid));
        $data = mysql_fetch_array($result2);
        $itemcount = $data[0];
        $otheritemcount = 0;
        if (1 < $itemcount) {
            $otheritemcount = get_query_val("tblinvoiceitems", "COUNT(*)", "invoiceid=" . (int) $invoiceid . (" AND id!=" . $itemid . " AND type NOT IN ('PromoHosting','PromoDomain','GroupDiscount')"));
        }
        if ($itemcount == 1 || $otheritemcount == 0) {
            update_query("tblinvoices", array("status" => "Cancelled"), array("id" => $invoiceid));
            logActivity("Cancelled Previous Domain Renewal Invoice - Invoice ID: " . $invoiceid . " - Domain: " . $domainname);
            run_hook("InvoiceCancelled", array("invoiceid" => $invoiceid));
        }
        delete_query("tblinvoiceitems", array("id" => $itemid));
        updateInvoiceTotal($invoiceid);
        logActivity("Removed Previous Domain Renewal Line Item - Invoice ID: " . $invoiceid . " - Domain: " . $domainname);
    }
}
Esempio n. 9
0
        }
        echo '>' . date($option) . '</option>' . "\n";
    }
    unset($option);
    echo '</select>
				</td>
				<td><label for="post_time">&emsp;' . $lang['blog']['post_time'] . '</label></td>
			</tr>
	</table><br />';
}
function blog_admin_module_settings_afterpost()
{
    global $lang;
    //truncate_posts should be numeric.
    if (!is_numeric($_POST['truncate_posts']) || !is_numeric($_POST['posts_per_page'])) {
        return show_error($lang['blog']['numeric_error'], 1, true);
    }
    if (empty($_POST['posts_per_page'])) {
        return show_error($lang['blog']['posts_per_page_error'], 1, true);
    } else {
        //Compose settings array
        $settings = array('allow_reactions' => isset($_POST['allow_reactions']) ? 'true' : 'false', 'truncate_posts' => $_POST['truncate_posts'], 'posts_per_page' => $_POST['posts_per_page'], 'post_date' => $_POST['post_date'], 'post_time' => $_POST['post_time']);
        //Save settings
        module_save_settings('blog', $settings);
    }
}
//Add hook for SEO capabilities.
$blog_url_prefix = '&amp;module=blog&amp;page=viewpost&amp;post=';
run_hook('blog_url_prefix', array(&$blog_url_prefix));
define('BLOG_URL_PREFIX', $blog_url_prefix);
unset($blog_url_prefix);
Esempio n. 10
0
/*
 * This file is part of pluck, the easy content management system
 * Copyright (c) pluck team
 * http://www.pluck-cms.org

 * Pluck is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * See docs/COPYING for the complete license.
*/
//Make sure the file isn't accessed directly.
defined('IN_PLUCK') or exit('Access denied!');
?>
	<p>
		<strong><?php 
echo $lang['options']['message'];
?>
</strong>
	</p>
<?php 
run_hook('admin_options_before');
showmenudiv($lang['settings']['title'], $lang['options']['settings_descr'], 'data/image/settings.png', '?action=settings');
showmenudiv($lang['modules_manage']['title'], $lang['options']['modules_descr'], 'data/image/modules.png', '?action=managemodules');
showmenudiv($lang['modules_settings']['title'], $lang['options']['modules_sett_descr'], 'data/image/settings2.png', '?action=modulesettings');
showmenudiv($lang['theme']['title'], $lang['options']['themes_descr'], 'data/image/themes.png', '?action=theme');
showmenudiv($lang['language']['title'], $lang['options']['lang_descr'], 'data/image/language.png', '?action=language');
showmenudiv($lang['changepass']['title'], $lang['options']['pass_descr'], 'data/image/password.png', '?action=changepass');
run_hook('admin_options_after');
Esempio n. 11
0
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * See docs/COPYING for the complete license.
*/
//Make sure the file isn't accessed directly.
defined('IN_PLUCK') or exit('Access denied!');
?>
<p>
	<strong><?php 
echo $lang['page']['message'];
?>
</strong>
</p>
<?php 
//Run hook.
run_hook('admin_pages_before');
//New page button.
showmenudiv($lang['page']['new'], null, 'data/image/newpage.png', '?action=editpage');
//Manage images button.
showmenudiv($lang['images']['title'], null, 'data/image/image.png', '?action=images');
//Manage files button.
showmenudiv($lang['files']['title'], null, 'data/image/file.png', '?action=files');
//Show pages.
$pages = get_pages();
if ($pages) {
    foreach ($pages as $page) {
        show_page_box($page);
    }
    unset($page);
}
Esempio n. 12
0
        $array = array("firstname" => $firstname, "lastname" => $lastname, "companyname" => $companyname, "email" => $email, "address1" => $address1, "address2" => $address2, "city" => $city, "state" => $state, "postcode" => $postcode, "country" => $country, "phonenumber" => $phonenumber, "subaccount" => $subaccount, "permissions" => $permissions, "domainemails" => $domainemails, "generalemails" => $generalemails, "invoiceemails" => $invoiceemails, "productemails" => $productemails, "supportemails" => $supportemails, "affiliateemails" => $affiliateemails);
        if ($password && $password != $aInt->lang("fields", "entertochange")) {
            $array['password'] = generateClientPW($password);
        }
        $where = array("id" => $contactid);
        update_query($table, $array, $where);
        run_hook("ContactEdit", array_merge(array("userid" => $userid, "contactid" => $contactid, "olddata" => $oldcontactdata), $array));
    }
    redir("userid=" . $userid . "&contactid=" . $contactid);
    exit;
}
if ($action == "delete") {
    check_token("WHMCS.admin.default");
    delete_query("tblcontacts", array("id" => $contactid, "userid" => $userid));
    update_query("tblclients", array("billingcid" => ""), array("id" => $userid, "billingcid" => $contactid));
    run_hook("ContactDelete", array("userid" => $userid, "contactid" => $contactid));
    redir("userid=" . $userid);
    exit;
}
ob_start();
if ($error) {
    infoBox($aInt->lang("global", "validationerror"), $error);
    echo $infobox;
}
echo "\n<form action=\"";
echo $_SERVER['PHP_SELF'];
echo "\" method=\"get\">\n<input type=\"hidden\" name=\"userid\" value=\"";
echo $userid;
echo "\">\n";
echo $aInt->lang("clientsummary", "contacts");
echo ": ";
    gp_LogGatewayTrans("PayPal", $ipnValid[1], "Invalid IPN");
    exit;
}
// Check that the payment status is completed
if ($ipnValid[1]['payment_status'] !== "Completed") {
    gp_LogGatewayTrans("PayPal", $ipnValid[1], $ipnValid[1]['payment_status']);
    exit;
}
//Check that we havn't credited for it already
$query = 'SELECT * FROM tblaccounts WHERE transid=\'' . $ipnValid[1]['txn_id'] . '\'';
if (mysql_num_rows(mysql_query($query))) {
    exit;
}
$gpSettings = gp_LoadSettings();
//Begin to credit the client
//TODO: Uncomment
//$clientId = 1;
$clientId = gp_LoadUserFromHash($ipnValid[1]['custom']);
gp_LogGatewayTrans("PayPal", $ipnValid[1], "Successful");
if ($clientId) {
    //Apply the Credit
    // Get the clients currency and apply the rate
    $currency = getCurrency($clientId);
    //Write the Transactions
    mysql_query("INSERT INTO `tblaccounts` (userid,gateway,`date`,description,amountin,fees,transid,invoiceid,`rate`)\n   \t\t\t\t\t\t values ({$clientId},'paypal',now(),'" . $gpSettings['SystemName'] . " Credit'," . $ipnValid[1]['mc_gross'] . "," . $ipnValid[1]['mc_fee'] . ",'" . $ipnValid[1]['txn_id'] . "',0,'" . $currency['rate'] . "')");
    //Increase the credit balance
    mysql_query("UPDATE `tblclients` set credit = credit + " . $ipnValid[1]['mc_gross'] . " where id = {$clientId}");
    //Add it to the credit log
    mysql_query("INSERT INTO `tblcredit` (clientid,date,description,amount)\n\t\t\t\t\t values ({$clientId},now(),'" . $gpSettings['SystemName'] . " Credit " . $ipnValid[1]['payer_email'] . "'," . $ipnValid[1]['mc_gross'] . ")");
    run_hook("groupPay_paymentComplete", array("clientId" => $clientId, "paypalInfo" => $ipnValid[1]));
}
Esempio n. 14
0
        $result = select_query("tblservers", "active,type", array("id" => $id));
        $data = mysql_fetch_array($result);
        if ($type == $data['type']) {
            $active = $data['active'];
        } else {
            $active = "";
        }
        update_query("tblservers", array("name" => $name, "type" => $type, "ipaddress" => trim($ipaddress), "assignedips" => trim($assignedips), "hostname" => trim($hostname), "monthlycost" => trim($monthlycost), "noc" => $noc, "statusaddress" => trim($statusaddress), "nameserver1" => trim($nameserver1), "nameserver1ip" => trim($nameserver1ip), "nameserver2" => trim($nameserver2), "nameserver2ip" => trim($nameserver2ip), "nameserver3" => trim($nameserver3), "nameserver3ip" => trim($nameserver3ip), "nameserver4" => trim($nameserver4), "nameserver4ip" => trim($nameserver4ip), "nameserver5" => trim($nameserver5), "nameserver5ip" => trim($nameserver5ip), "maxaccounts" => trim($maxaccounts), "username" => trim($username), "password" => encrypt(trim($password)), "accesshash" => trim($accesshash), "secure" => $secure, "disabled" => $disabled, "active" => $active), array("id" => $id));
        run_hook("ServerEdit", array("serverid" => $id));
        redir("savesuccess=true");
    } else {
        $result = select_query("tblservers", "id", array("type" => $type, "active" => "1"));
        $data = mysql_fetch_array($result);
        $active = $data['id'] ? "" : "1";
        $newid = insert_query("tblservers", array("name" => $name, "type" => $type, "ipaddress" => trim($ipaddress), "assignedips" => trim($assignedips), "hostname" => trim($hostname), "monthlycost" => trim($monthlycost), "noc" => $noc, "statusaddress" => trim($statusaddress), "nameserver1" => trim($nameserver1), "nameserver1ip" => trim($nameserver1ip), "nameserver2" => trim($nameserver2), "nameserver2ip" => trim($nameserver2ip), "nameserver3" => trim($nameserver3), "nameserver3ip" => trim($nameserver3ip), "nameserver4" => trim($nameserver4), "nameserver4ip" => trim($nameserver4ip), "nameserver5" => trim($nameserver5), "nameserver5ip" => trim($nameserver5ip), "maxaccounts" => trim($maxaccounts), "username" => trim($username), "password" => encrypt(trim($password)), "accesshash" => trim($accesshash), "secure" => $secure, "active" => $active, "disabled" => $disabled));
        run_hook("ServerAdd", array("serverid" => $newid));
        redir("createsuccess=true");
    }
    exit;
}
if ($action == "savegroup") {
    check_token("WHMCS.admin.default");
    if ($id) {
        update_query("tblservergroups", array("name" => $name, "filltype" => $filltype), array("id" => $id));
        delete_query("tblservergroupsrel", array("groupid" => $id));
    } else {
        $id = insert_query("tblservergroups", array("name" => $name, "filltype" => $filltype));
    }
    if ($selectedservers) {
        foreach ($selectedservers as $serverid) {
            insert_query("tblservergroupsrel", array("groupid" => $id, "serverid" => $serverid));
Esempio n. 15
0
 public function deleteContact($contactid)
 {
     delete_query("tblcontacts", array("userid" => $this->userid, "id" => $contactid));
     update_query("tblclients", array("billingcid" => ""), array("billingcid" => $contactid, "id" => $this->userid));
     run_hook("ContactDelete", array("userid" => $this->userid, "contactid" => $contactid));
     return true;
 }
Esempio n. 16
0
echo "</label> <input type=\"checkbox\" name=\"donotrenew\" id=\"donotrenew\"";
if ($donotrenew) {
    echo " checked";
}
echo "> <label for=\"donotrenew\">";
echo $aInt->lang("domains", "donotrenew");
echo "</label></td></tr>\n";
if (function_exists($registrar . "_AdminDomainsTabFields")) {
    $fieldsarray = call_user_func($registrar . "_AdminDomainsTabFields", $params);
    if (is_array($fieldsarray)) {
        foreach ($fieldsarray as $k => $v) {
            echo "<tr><td class=\"fieldlabel\">" . $k . "</td><td class=\"fieldarea\" colspan=\"3\">" . $v . "</td></tr>";
        }
    }
}
$hookret = run_hook("AdminClientDomainsTabFields", array("id" => $id));
foreach ($hookret as $hookdat) {
    foreach ($hookdat as $k => $v) {
        echo "<td class=\"fieldlabel\">" . $k . "</td><td class=\"fieldarea\" colspan=\"3\">" . $v . "</td></tr>";
    }
}
$domainparts = explode(".", $domain, 2);
$tld = "." . $domainparts[1];
$tempdomainfields = $additionaldomainfields[$tld];
if ($tempdomainfields) {
    $result = select_query("tbldomainsadditionalfields", "", array("domainid" => $id));
    while ($data = mysql_fetch_array($result)) {
        $field_name = $data['name'];
        $field_value = $data['value'];
        $values[$field_name] = $field_value;
    }
Esempio n. 17
0
 /**
  * Modify objects
  */
 public function modify($dn, $attrs, $method = null)
 {
     if (DEBUG_ENABLED && (($fargs = func_get_args()) || ($fargs = 'NOARGS'))) {
         debug_log('Entered (%%)', 17, 0, __FILE__, __LINE__, __METHOD__, $fargs);
     }
     # Check our unique attributes.
     if (!$this->checkUniqueAttrs($dn, $attrs)) {
         return false;
     }
     $result = false;
     $summary = array();
     $current_attrs = $this->getDNAttrValues($dn, $method, LDAP_DEREF_NEVER, array('*'));
     # Go through our attributes and call our hooks for each attribute changing its value
     foreach ($attrs as $attr => $values) {
         # For new attributes
         if (count($values) && !isset($current_attrs[$attr])) {
             if (!run_hook('pre_attr_add', array('server_id' => $this->index, 'method' => $method, 'dn' => $dn, 'attr' => $attr, 'newvalue' => $values))) {
                 unset($attrs[$attr]);
                 system_message(array('title' => _('Attribute not added'), 'body' => sprintf('%s (<b>%s</b>)', _('Hook pre_attr_add prevented attribute from being added'), $attr), 'type' => 'warn'));
             } else {
                 $summary['add'][$attr]['new'] = $values;
             }
             # For modify attributes
         } elseif (count($values)) {
             if (!run_hook('pre_attr_modify', array('server_id' => $this->index, 'method' => $method, 'dn' => $dn, 'attr' => $attr, 'oldvalue' => $current_attrs[$attr], 'newvalue' => $values))) {
                 unset($attrs[$attr]);
                 system_message(array('title' => _('Attribute not modified'), 'body' => sprintf('%s (<b>%s</b>)', _('Hook pre_attr_modify prevented attribute from being modified'), $attr), 'type' => 'warn'));
             } else {
                 $summary['modify'][$attr]['new'] = $values;
                 $summary['modify'][$attr]['old'] = $current_attrs[$attr];
             }
             # For delete attributes
         } else {
             if (!run_hook('pre_attr_delete', array('server_id' => $this->index, 'method' => $method, 'dn' => $dn, 'attr' => $attr, 'oldvalue' => $current_attrs[$attr]))) {
                 unset($attrs[$attr]);
                 system_message(array('title' => _('Attribute not deleted'), 'body' => sprintf('%s (<b>%s</b>)', _('Hook pre_attr_delete prevented attribute from being deleted'), $attr), 'type' => 'warn'));
             } else {
                 $summary['delete'][$attr]['old'] = $current_attrs[$attr];
             }
         }
     }
     if (!count($attrs)) {
         return false;
     }
     if (run_hook('pre_entry_modify', array('server_id' => $this->index, 'method' => $method, 'dn' => $dn, 'attrs' => $attrs))) {
         $result = @ldap_modify($this->connect($method), $dn, $attrs);
         if ($result) {
             run_hook('post_entry_modify', array('server_id' => $this->index, 'method' => $method, 'dn' => $dn, 'attrs' => $attrs));
             foreach (array('add', 'modify', 'delete') as $mode) {
                 if (isset($summary[$mode])) {
                     foreach ($summary[$mode] as $attr => $values) {
                         switch ($mode) {
                             case 'add':
                                 run_hook(sprintf('post_attr_%s', $mode), array('server_id' => $this->index, 'method' => $method, 'dn' => $dn, 'attr' => $attr, 'newvalue' => $values['new']));
                                 break;
                             case 'modify':
                                 run_hook(sprintf('post_attr_%s', $mode), array('server_id' => $this->index, 'method' => $method, 'dn' => $dn, 'attr' => $attr, 'oldvalue' => $values['old'], 'newvalue' => $values['new']));
                                 break;
                             case 'delete':
                                 run_hook(sprintf('post_attr_%s', $mode), array('server_id' => $this->index, 'method' => $method, 'dn' => $dn, 'attr' => $attr, 'oldvalue' => $values['old']));
                                 break;
                             default:
                                 debug_dump_backtrace(sprintf('Unkown mode %s', $mode), 1);
                         }
                     }
                 }
             }
         } else {
             system_message(array('title' => _('Could not perform ldap_modify operation.'), 'body' => ldap_error_msg($this->getErrorMessage($method), $this->getErrorNum($method)), 'type' => 'error'));
         }
     }
     return $result;
 }
Esempio n. 18
0
/**
 * Strip slashes from GET, POST, and COOKIE variables if this
 * PHP install is configured to automatically addslashes()
 */
if (@get_magic_quotes_gpc() && (!isset($slashes_stripped) || !$slashes_stripped)) {
    array_stripslashes($_REQUEST);
    array_stripslashes($_GET);
    array_stripslashes($_POST);
    array_stripslashes($_COOKIE);
    $slashes_stripped = true;
}
# Create our application repository variable.
$app['server'] = $_SESSION[APPCONFIG]->getServer(get_request('server_id', 'REQUEST'));
/**
 * Look/evaluate our timeout
 */
if (!$app['server']->isSessionValid()) {
    system_message(array('title' => _('Session Timed Out'), 'body' => sprintf('%s %s %s', _('Your Session timed out after'), $app['server']->getValue('login', 'timeout'), _('min. of inactivity. You have been automatically logged out.')), 'type' => 'info'), sprintf('index.php?server_id=%s&refresh=SID_%s', $app['server']->getIndex(), $app['server']->getIndex()));
    die;
}
# If syslog is enabled, we need to include the supporting file.
if ($_SESSION[APPCONFIG]->getValue('debug', 'syslog')) {
    require LIBDIR . 'syslog.php';
}
/**
 * At this point we have read all our additional function PHP files and our configuration.
 * If we are using hooks, run the session_init hook.
 */
if (function_exists('run_hook')) {
    run_hook('post_session_init', array());
}
Esempio n. 19
0
            }
        } elseif (defined('CURRENT_MODULE_PAGE')) {
            if (!function_exists(CURRENT_MODULE_DIR . '_page_site_' . CURRENT_MODULE_PAGE) || !module_is_included_in_page(CURRENT_MODULE_DIR, CURRENT_PAGE_SEONAME) || !module_is_compatible(CURRENT_MODULE_DIR)) {
                header('HTTP/1.0 404 Not Found');
                if (!defined('CURRENT_NOTFOUND')) {
                    define('CURRENT_NOTFOUND', true);
                }
            }
        }
    } else {
        header('HTTP/1.0 404 Not Found');
        if (!defined('CURRENT_NOTFOUND')) {
            define('CURRENT_NOTFOUND', true);
        }
    }
}
//If a page has been requested that does not exist, return 404 header.
if (defined('CURRENT_PAGE_SEONAME') && !defined('CURRENT_PAGE_FILENAME')) {
    header('HTTP/1.0 404 Not Found');
    if (!defined('CURRENT_NOTFOUND')) {
        define('CURRENT_NOTFOUND', true);
    }
}
//Allow modules to manipulate theme
$page_theme = THEME;
run_hook('site_theme', array(&$page_theme));
//Allow modules to manipulate theme-filename
$page_theme_file = 'theme';
run_hook('site_theme_file', array(&$page_theme_file));
//Now, include the theme
include_once 'data/themes/' . $page_theme . '/' . $page_theme_file . '.php';
Esempio n. 20
0
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * See docs/COPYING for the complete license.
*/
//Make sure the file isn't accessed directly.
defined('IN_PLUCK') or exit('Access denied!');
?>
<p>
	<strong><?php 
echo $lang['modules']['message'];
?>
</strong>
</p>
<?php 
run_hook('admin_modules_before');
?>
<div class="smallmenu">
	<span class="smallmenu_button">
		<a href="?action=module_addtosite" style="background: url('data/image/add_small.png') no-repeat;"><?php 
echo $lang['modules_manage']['add'];
?>
</a>
	</span>
</div>
<?php 
foreach ($module_list as $module) {
    //Load module admin pages.
    if (file_exists('data/modules/' . $module . '/' . $module . '.admin.php')) {
        require_once 'data/modules/' . $module . '/' . $module . '.admin.php';
    }
Esempio n. 21
0
 public function logout()
 {
     if ($this->isLoggedIn()) {
         update_query("tbladminlog", array("logouttime" => "now()"), array("sessionid" => session_id()));
         $adminid = $_SESSION['adminid'];
         session_unset();
         session_destroy();
         $this->unsetRememberMeCookie();
         run_hook("AdminLogout", array("adminid" => $adminid));
         return true;
     }
     return false;
 }
Esempio n. 22
0
 if (!is_array($mass_delete)) {
     pla_error(_('Malformed mass_delete array.'));
 }
 if (count($mass_delete) == 0) {
     echo '<br />';
     printf('<center>%s</center>', _('You did not select any entries to delete.'));
     die;
 }
 // @todo: Should sort these entries, so that they are deleted in order, if a user selects children.
 foreach ($mass_delete as $dn => $junk) {
     printf(_('Deleting %s'), htmlspecialchars($dn));
     flush();
     if (run_hook('pre_entry_delete', array('server_id' => $ldapserver->server_id, 'dn' => $dn))) {
         $success = $ldapserver->delete($dn);
         if ($success) {
             run_hook('post_entry_delete', array('server_id' => $ldapserver->server_id, 'dn' => $dn));
             printf(' <span style="color:green">%s</span>.<br />', _('Success'));
             $successfully_delete_dns[] = $dn;
         } else {
             printf(' <span style="color:red">%s</span>.<br /> (%s)<br />', _('Failed'), $ldapserver->error());
             $failed_dns[] = $dn;
         }
     }
     flush();
 }
 echo '<blockquote>';
 echo '</small>';
 $failed_count = count($failed_dns);
 $total_count = count($mass_delete);
 if ($failed_count > 0) {
     printf('<span style="color: red; font-weight: bold;">' . _('%s of %s entries failed to be deleted.') . '</span>', $failed_count, $total_count);
Esempio n. 23
0
<?php

/**
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
define("CLIENTAREA", true);
require "init.php";
if (!isset($_SESSION['uid'])) {
    redir("", "index.php");
}
run_hook("ClientLogout", array("userid" => $_SESSION['uid']));
unset($_SESSION['uid']);
unset($_SESSION['cid']);
unset($_SESSION['upw']);
wDelCookie("User");
$pagetitle = $_LANG['logouttitle'];
$breadcrumbnav = "<a href=\"index.php\">" . $_LANG['globalsystemname'] . "</a> > <a href=\"clientarea.php\">" . $_LANG['clientareatitle'] . "</a> > <a href=\"logout.php\">" . $_LANG['logouttitle'] . "</a>";
$pageicon = "images/clientarea_big.gif";
$templatefile = "logout";
initialiseClientArea($pagetitle, $pageicon, $breadcrumbnav);
outputClientArea($templatefile);
Esempio n. 24
0
/**
 * Displays page content. For use in themes.
 *
 * @since 4.6
 * @package site
 */
function theme_content()
{
    //Get needed variables
    global $lang;
    //Show "not found" error message if something was missing
    if (defined('CURRENT_NOTFOUND')) {
        echo $lang['general']['not_found'];
    } elseif (defined('CURRENT_PAGE_SEONAME') && !defined('CURRENT_MODULE_DIR')) {
        //Check if page exists
        if (defined('CURRENT_PAGE_FILENAME')) {
            include PAGE_DIR . '/' . CURRENT_PAGE_FILENAME;
            run_hook('theme_content_before');
            run_hook('theme_content', array(&$content));
            //Check for module tags in content
            $regex = '/\\{pluck (.*?)\\}/';
            if (preg_match($regex, $content)) {
                //Split content in chunks.
                $content = preg_split($regex, $content, null, PREG_SPLIT_DELIM_CAPTURE);
                foreach ($content as $value) {
                    //Check if chunk is a show_module command
                    if (preg_match('/show_module\\((.*?)\\)/', $value, $matches)) {
                        $module_to_include = $matches[1];
                        unset($matches);
                        //Check if we need to pass a variable to the module.
                        if (strpos($module_to_include, ',')) {
                            $module_to_include = explode(',', $module_to_include);
                            if (module_is_compatible($module_to_include[0]) && function_exists($module_to_include[0] . '_theme_main')) {
                                call_user_func_array($module_to_include[0] . '_theme_main', array(null, $module_to_include[1]));
                            }
                            unset($module_to_include);
                        } else {
                            //Check if module is compatible, and the function exists.
                            if (module_is_compatible($module_to_include) && function_exists($module_to_include . '_theme_main')) {
                                call_user_func_array($module_to_include . '_theme_main', array(null, null));
                            }
                            unset($module_to_include);
                        }
                    } else {
                        echo $value;
                    }
                }
            } else {
                echo $content;
            }
            run_hook('theme_content_after');
        } else {
            echo $lang['general']['not_found'];
        }
    } elseif (defined('CURRENT_PAGE_SEONAME') && defined('CURRENT_MODULE_DIR')) {
        $module_page_site = call_user_func(CURRENT_MODULE_DIR . '_pages_site');
        if (!empty($module_page_site)) {
            foreach ($module_page_site as $module_page) {
                if ($module_page['func'] == CURRENT_MODULE_PAGE) {
                    call_user_func(CURRENT_MODULE_DIR . '_page_site_' . $module_page['func']);
                }
            }
            unset($module_page);
        }
    } else {
        echo $lang['general']['not_found'];
    }
}
Esempio n. 25
0
$dn = rawurldecode($_POST['dn']);
$is_binary_val = isset($_POST['binary']) ? true : false;
$encoded_dn = rawurlencode($dn);
$encoded_attr = rawurlencode($attr);
if ($ldapserver->isAttrReadOnly($attr)) {
    pla_error(sprintf(_('The attribute "%s" is flagged as read-only in the phpLDAPadmin configuration.'), htmlspecialchars($attr)));
}
// special case for binary attributes:
// we must go read the data from the file.
if ($is_binary_val) {
    $file = $_FILES['new_value']['tmp_name'];
    $f = fopen($file, 'r');
    $binary_value = fread($f, filesize($file));
    fclose($f);
    $new_value = $binary_value;
}
$new_entry = array($attr => $new_value);
// Check to see if this is a unique Attribute
if ($badattr = $ldapserver->checkUniqueAttr($dn, $attr, $new_entry)) {
    $search_href = sprintf('search.php?search=true&form=advanced&server_id=%s&filter=%s=%s', $ldapserver->server_id, $attr, $badattr);
    pla_error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'), $attr, $badattr, $dn, $search_href));
}
// Call the custom callback for each attribute modification
// and verify that it should be modified.
if (run_hook('pre_attr_add', array('server_id' => $ldapserver->server_id, 'dn' => $dn, 'attr_name' => $attr, 'new_value' => $new_entry))) {
    $add_result = $ldapserver->attrModify($dn, $new_entry);
    if (!$add_result) {
        pla_error(_('Could not perform ldap_mod_add operation.'), $ldapserver->error(), $ldapserver->errno());
    }
}
header(sprintf('Location: template_engine.php?server_id=%s&dn=%s&modified_attrs[]=%s', $ldapserver->server_id, $encoded_dn, $encoded_attr));
Esempio n. 26
0
    check_token("WHMCS.admin.default");
    update_query("tblnetworkissues", array("status" => "Resolved", "enddate" => "now()"), array("id" => $id));
    run_hook("NetworkIssueClose", array("id" => $id));
    redir("view=resolved");
    exit;
}
if ($action == "reopen") {
    check_token("WHMCS.admin.default");
    update_query("tblnetworkissues", array("status" => "In Progress", "enddate" => "NULL"), array("id" => $id));
    run_hook("NetworkIssueReopen", array("id" => $id));
    redir();
    exit;
}
if ($action == "delete") {
    check_token("WHMCS.admin.default");
    run_hook("NetworkIssueDelete", array("id" => $id));
    delete_query("tblnetworkissues", array("id" => $id));
    redir();
    exit;
}
$t_query = "SHOW COLUMNS FROM tblnetworkissues LIKE 'type'";
$t_result = full_query($t_query);
if (0 < mysql_num_rows($t_result)) {
    $t_row = mysql_fetch_row($t_result);
    $type_options = explode('\',\'', preg_replace('/(enum|set)\\(\'(.+?)\'\\)/', '$1', $t_row[1]));
}
$p_query = "SHOW COLUMNS FROM tblnetworkissues LIKE 'priority'";
$p_result = full_query($p_query);
if (0 < mysql_num_rows($p_result)) {
    $p_row = mysql_fetch_row($p_result);
    $priority_options = explode('\',\'', preg_replace('/(enum|set)\\(\'(.+?)\'\\)/', '$1', $p_row[1]));
Esempio n. 27
0
 } else {
     if (!$invoicestatus) {
         $paymentstatus = "<span class=\"textred\">Invoice Deleted</span>";
     } else {
         if ($invoicestatus == "Paid") {
             $paymentstatus = "<span class=\"textgreen\">" . $aInt->lang("status", "complete") . "</span>";
         } else {
             if ($invoicestatus == "Unpaid") {
                 $paymentstatus = "<span class=\"textred\">" . $aInt->lang("status", "incomplete") . "</span>";
             } else {
                 $paymentstatus = getInvoiceStatusColour($invoicestatus);
             }
         }
     }
 }
 run_hook("ViewOrderDetailsPage", array("orderid" => $id, "ordernum" => $ordernum, "userid" => $userid, "amount" => $amount, "paymentmethod" => $paymentmethod, "invoiceid" => $invoiceid, "status" => $orderstatus));
 $clientnotes = array();
 $result = select_query("tblnotes", "tblnotes.*,(SELECT CONCAT(firstname,' ',lastname) FROM tbladmins WHERE tbladmins.id=tblnotes.adminid) AS adminuser", array("userid" => $userid, "sticky" => "1"), "modified", "DESC");
 while ($data = mysql_fetch_assoc($result)) {
     $data['created'] = fromMySQLDate($data['created'], 1);
     $data['modified'] = fromMySQLDate($data['modified'], 1);
     $data['note'] = autoHyperLink(nl2br($data['note']));
     $clientnotes[] = $data;
 }
 if (count($clientnotes)) {
     echo "<div id=\"clientsimportantnotes\">\n";
     foreach ($clientnotes as $note) {
         echo "<div class=\"ticketstaffnotes\">\n    <table class=\"ticketstaffnotestable\">\n        <tr>\n            <td>" . $note['adminuser'] . "</td>\n            <td align=\"right\">" . $note['modified'] . "</td>\n        </tr>\n    </table>\n    <div>\n        " . $note['note'] . "\n        <div style=\"float:right;\"><a href=\"clientsnotes.php?userid=" . $userid . "&action=edit&id=" . $note['id'] . "\"><img src=\"images/edit.gif\" width=\"16\" height=\"16\" align=\"absmiddle\" /></a></div>\n    </div>\n</div>\n";
     }
     echo "</div>";
 }
Esempio n. 28
0
         foreach ($adminbuttonarray as $key => $value) {
             $modulebtns[] = $frm->button($key, "runModuleCommand('custom','" . $value . "')");
         }
     }
     $tbl->add($aInt->lang("services", "modulecommands"), "<div id=\"modcmdbtns\">" . implode(" ", $modulebtns) . "</div><div id=\"modcmdworking\" style=\"display:none;text-align:center;\"><img src=\"images/loader.gif\" /> &nbsp; Working...</div>", 1);
     if (function_exists($module . "_AdminServicesTabFields")) {
         $params = ModuleBuildParams($id);
         $fieldsarray = call_user_func($params['moduletype'] . "_AdminServicesTabFields", $params);
         if (is_array($fieldsarray)) {
             foreach ($fieldsarray as $k => $v) {
                 $tbl->add($k, $v, 1);
             }
         }
     }
 }
 $hookret = run_hook("AdminClientServicesTabFields", array("id" => $id));
 foreach ($hookret as $hookdat) {
     foreach ($hookdat as $k => $v) {
         $tbl->add($k, $v, 1);
     }
 }
 $addonshtml = "";
 $aInt->sortableTableInit("nopagination");
 $service = new WHMCS_Service($id);
 $addons = $service->getAddons();
 foreach ($addons as $vals) {
     $tabledata[] = array($vals['regdate'], $vals['name'], $vals['pricing'], $vals['status'], $vals['nextduedate'], "<a href=\"" . $PHP_SELF . "?userid=" . $userid . "&id=" . $id . "&aid=" . $vals['id'] . "\"><img src=\"images/edit.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Edit\"></a>", "<a href=\"#\" onClick=\"doDeleteAddon('" . $vals['id'] . "');return false\"><img src=\"images/delete.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Delete\"></a>");
 }
 $addonshtml = $aInt->sortableTable(array($aInt->lang("addons", "regdate"), $aInt->lang("addons", "name"), $aInt->lang("global", "pricing"), $aInt->lang("fields", "status"), $aInt->lang("fields", "nextduedate"), "", ""), $tabledata);
 $tbl->add($aInt->lang("addons", "title"), $addonshtml . "<div style=\"padding:5px 25px;\"><a href=\"clientsservices.php?userid=" . $userid . "&id=" . $id . "&aid=add\"><img src=\"images/icons/add.png\" border=\"0\" align=\"top\" /> Add New Addon</a></div>", 1);
 $customfields = getCustomFields("product", $packageid, $id, true);
Esempio n. 29
0
function closeTicket($id)
{
    global $whmcs;
    $status = get_query_val("tbltickets", "status", array("id" => $id));
    if ($status == "Closed") {
        return false;
    }
    if (defined("CLIENTAREA")) {
        addTicketLog($id, "Closed by Client");
    } else {
        if (defined("ADMINAREA")) {
            addTicketLog($id, "Status changed to Closed");
        } else {
            addTicketLog($id, "Ticket Auto Closed For Inactivity");
        }
    }
    update_query("tbltickets", array("status" => "Closed"), array("id" => $id));
    if ($whmcs->get_config("TicketFeedback")) {
        $feedbackcheck = get_query_val("tblticketfeedback", "id", array("ticketid" => $id));
        if (!$feedbackcheck) {
            sendMessage("Support Ticket Feedback Request", $id);
        }
    }
    run_hook("TicketClose", array("ticketid" => $id));
    return true;
}
Esempio n. 30
0
 echo "<s";
 echo "elect name=\"freedomaintlds[]\" size=\"5\" multiple>";
 $query = "SELECT DISTINCT extension FROM tbldomainpricing ORDER BY `order` ASC";
 $result = full_query($query);
 while ($data = mysql_fetch_array($result)) {
     $extension = $data['extension'];
     echo "<option";
     if (in_array($extension, $freedomaintlds)) {
         echo " selected";
     }
     echo ">" . $extension;
 }
 echo "</select><br>";
 echo $aInt->lang("products", "usectrlclickpayterms");
 echo "</td></tr>\n</table>\n\n  </div>\n</div>\n<div id=\"tab7box\" class=\"tabbox\">\n  <div id=\"tab_content\">\n\n<table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\n";
 $producteditfieldsarray = run_hook("AdminProductConfigFields", array("pid" => $id));
 if (is_array($producteditfieldsarray)) {
     foreach ($producteditfieldsarray as $pv) {
         foreach ($pv as $k => $v) {
             echo "<tr><td class=\"fieldlabel\">" . $k . "</td><td class=\"fieldarea\">" . $v . "</td></tr>";
         }
     }
 }
 echo "<tr><td class=\"fieldlabel\">";
 echo $aInt->lang("products", "customaffiliatepayout");
 echo "</td><td class=\"fieldarea\"><input type=\"radio\" name=\"affiliatepaytype\" value=\"\"";
 if ($affiliatepaytype == "") {
     echo " checked";
 }
 echo "> ";
 echo $aInt->lang("affiliates", "usedefault");