ارجو حل هذه المشكله

7moodi11

عضو جديد
11 فبراير 2012
97
0
0
كيف اضيف امر كرون

اللي هو

PHP:
php -q /home/so0kr/public_html/des/des/admin/cron.php

بالاف تي بي

ضفته في ملف كرون مثل كذا ثاني سطر وما قبل وصار يحولني الى هذا كل مادخلت على السكربت من عندي يسوي كذا http://www.yourdomain.com/whmcs/banned.php ارجو من الجميع يصلحلي الملف هذا ويرد ع الرد

<?php /*
[!_!_!_ DeZendeD By MtRp - Warez-Team.Com !_!_!_ ]
*/
?>php -q /home/so0kr/public_html/des/des/admin/cron.php<?

require dirname (__FILE__) . '/../dbconnect.php';
$silent = 'true';
include dirname (__FILE__) . '/../includes/functions.php';
include dirname (__FILE__) . '/../includes/clientfunctions.php';
include dirname (__FILE__) . '/../includes/serverfunctions.php';
include dirname (__FILE__) . '/../includes/gatewayfunctions.php';
include dirname (__FILE__) . '/../includes/ccfunctions.php';
include dirname (__FILE__) . '/../includes/processinvoices.php';
include dirname (__FILE__) . '/../includes/invoicefunctions.php';

$cronreport = 'Cron Job Report for ' . date ('d-m-Y H:i:s') . '<br><br>';
createinvoices ();
invoicesaddlatefee ();
if (!$disableccprocessing)
{
ccprocessing ();
}

sendoverdueinvoicereminders ();
if ($CONFIG['SendReminder'] == 'on')
{
$reminders = '';
if ($CONFIG['SendInvoiceReminderDays'])
{
$invoicedateyear = date ('Ymd', mktime (0, 0, 0, date ('m'), date ('d') + $CONFIG['SendInvoiceReminderDays'], date ('Y')));
$query = 'SELECT * FROM tblinvoices WHERE duedate=\'' . $invoicedateyear . '\' AND `status`=\'Unpaid\'';
$result = mysql_query ($query);
$i = 0;
while ($data = mysql_fetch_array ($result))
{
$id = $data['id'];
sendmessage ('Invoice Payment Reminder', $id);
++$i;
}

$cronreport .= '' . $i . ' Invoice Payment Reminders Sent<br><br>';
}

$subsduedate = date ('Ymd', mktime (0, 0, 0, date ('m'), date ('d') - 2, date ('Y')));
$i = 0;
$query = 'SELECT gateway FROM tblpaymentgateways WHERE setting=\'type\' AND value=\'Subscriptions\'';
$result = mysql_query ($query);
$num_rows = mysql_num_rows ($result);
if ($num_rows != '0')
{
$gatewaysquery = '';
while ($data = mysql_fetch_array ($result))
{
if ($i == 0)
{
$gatewaysquery = 'paymentmethod=\'' . $data['gateway'] . '\'';
}
else
{
$gatewaysquery .= ' OR paymentmethod=\'' . $data['gateway'] . '\'';
}

++$i;
}

$query = 'SELECT * FROM tblhosting WHERE domainstatus!=\'Terminated\' AND billingcycle!=\'Free Account\' AND billingcycle!=\'One Time\' AND nextduedate=\'' . $subsduedate . '\' AND nextduedate!=\'00000000\' AND (' . $gatewaysquery . ') ORDER BY domain ASC';
$result = mysql_query ($query);
$i = 0;
while ($data = mysql_fetch_array ($result))
{
$id = $data['id'];
$userid = $data['userid'];
sendmessage ('Subscription Payment Due', $id);
$reminders .= ' - Sent to User ID ' . ltrim ($userid, '0') . '<br>';
++$i;
}

$query = 'SELECT * FROM tblhostingaddons WHERE nextduedate=\'' . $subsduedate . '\' AND nextduedate!=\'00000000\' AND `status`!=\'Terminated\' AND billingcycle!=\'Free\' AND billingcycle!=\'One Time\' AND (' . $gatewaysquery . ')';
$result = mysql_query ($query);
while ($data = mysql_fetch_array ($result))
{
$id = $data['id'];
$userid = $data['userid'];
sendmessage ('Addon Subscription Payment Due', $id);
$reminders .= ' - Sent to User ID ' . ltrim ($userid, '0') . '<br>';
++$i;
}

$cronreport .= '' . $i . ' Subscription Payment Reminders Sent<br>';
if ($reminders != '')
{
$cronreport .= $reminders;
}

$cronreport .= '<br>';
}
}

$renewalsnoticescount = 0;
$renewals = explode (',', $CONFIG['DomainRenewalNotices']);
foreach ($renewals as $renewal)
{
if ($renewal)
{
$renewaldate = date ('Y-m-d', mktime (0, 0, 0, date ('m'), date ('d') + $renewal, date ('Y')));
$query = '' . 'SELECT * FROM tbldomains WHERE status=\'Active\' AND nextduedate=\'' . $renewaldate . '\' AND recurringamount!=\'0.00\'';
$result = mysql_query ($query);
while ($data = mysql_fetch_array ($result))
{
$domainid = $data['id'];
sendmessage ('Upcoming Domain Renewal Notice', $domainid, $renewal);
++$renewalsnoticescount;
}

continue;
}
}

$cronreport .= '' . $renewalsnoticescount . ' Upcoming Domain Renewal Notices Sent<br><br>';
if ($CONFIG['AutoSuspension'] == 'on')
{
$suspended = '';
$i = 0;
$suspenddateday = date ('d', mktime (0, 0, 0, date ('m'), date ('d') - $CONFIG['AutoSuspensionDays'], date ('Y')));
$suspenddatemonth = date ('m', mktime (0, 0, 0, date ('m'), date ('d') - $CONFIG['AutoSuspensionDays'], date ('Y')));
$suspenddateyear = date ('Y', mktime (0, 0, 0, date ('m'), date ('d') - $CONFIG['AutoSuspensionDays'], date ('Y')));
$suspenddate = $suspenddateyear . $suspenddatemonth . $suspenddateday;
$query3 = '' . 'SELECT * FROM tblhosting WHERE domainstatus=\'Active\' AND billingcycle!=\'Free Account\' AND billingcycle!=\'One Time\' AND overideautosuspend!=\'on\' AND nextduedate<=\'' . $suspenddate . '\' ORDER BY domain ASC';
$result3 = mysql_query ($query3);
while ($data = mysql_fetch_array ($result3))
{
$id = $data['id'];
$userid = $data['userid'];
$domain = $data['domain'];
$nextduedate = $data['nextduedate'];
$server = $data['server'];
$regdate = frommysqldate ($regdate);
$nextduedate = frommysqldate ($nextduedate);
$query2 = '' . 'SELECT * FROM tblclients WHERE id=\'' . $userid . '\'';
$result2 = mysql_query ($query2);
$data2 = mysql_fetch_array ($result2);
$firstname = $data2['firstname'];
$lastname = $data2['lastname'];
$query2 = '' . 'SELECT type FROM tblservers WHERE id=\'' . $server . '\'';
$result2 = mysql_query ($query2);
$data2 = mysql_fetch_array ($result2);
$type = $data2['type'];
if (file_exists (dirname (__FILE__) . ('' . '/../modules/servers/' . $type . '/' . $type . '.php')))
{
require_once dirname (__FILE__) . ('' . '/../modules/servers/' . $type . '/' . $type . '.php');
$serverresult = serversuspendaccount ($id);
}

if ($serverresult == 'success')
{
sendmessage ('Account Suspended', $id);
$suspended .= '' . ' - Suspended Account: ' . $firstname . ' ' . $lastname . ' - ' . $domain . ' (Due Date: ' . $nextduedate . ')<br>';
logactivity ('' . 'Cron Job: Suspended Account (Hosting ID: ' . $id . ' - User ID: ' . $userid . ')');
++$i;
continue;
}
else
{
$suspended .= '' . ' - Manual Suspend Required: ' . $firstname . ' ' . $lastname . ' - ' . $domain . ' (Due Date: ' . $nextduedate . ')<br>';
logactivity ('' . 'Cron Job: Suspend Failed (Hosting ID: ' . $id . ' - User ID: ' . $userid . ' - Error: ' . $serverresult . ')');
continue;
}
}

$cronreport .= '' . $i . ' Accounts Suspended<br>';
if ($suspended != '')
{
$cronreport .= $suspended . '<br>';
}
else
{
$cronreport .= '<br>';
}
}

if ($CONFIG['AutoTermination'] == 'on')
{
$terminated = '';
$i = 0;
$terminatedateday = date ('d', mktime (0, 0, 0, date ('m'), date ('d') - $CONFIG['AutoTerminationDays'], date ('Y')));
$terminatedatemonth = date ('m', mktime (0, 0, 0, date ('m'), date ('d') - $CONFIG['AutoTerminationDays'], date ('Y')));
$terminatedateyear = date ('Y', mktime (0, 0, 0, date ('m'), date ('d') - $CONFIG['AutoTerminationDays'], date ('Y')));
$terminatedate = $terminatedateyear . $terminatedatemonth . $terminatedateday;
$query = '' . 'SELECT * FROM tblhosting WHERE (domainstatus=\'Active\' OR domainstatus=\'Suspended\') AND billingcycle!=\'Free Account\' AND billingcycle!=\'One Time\' AND nextduedate<=\'' . $terminatedate . '\' AND overideautosuspend!=\'on\' ORDER BY domain ASC';
$result = mysql_query ($query);
while ($data = mysql_fetch_array ($result))
{
$id = $data['id'];
$userid = $data['userid'];
$domain = $data['domain'];
$nextduedate = $data['nextduedate'];
$server = $data['server'];
$regdate = frommysqldate ($regdate);
$nextduedate = frommysqldate ($nextduedate);
$query2 = '' . 'SELECT * FROM tblclients WHERE id=\'' . $userid . '\'';
$result2 = mysql_query ($query2);
$data2 = mysql_fetch_array ($result2);
$firstname = $data2['firstname'];
$lastname = $data2['lastname'];
$query2 = '' . 'SELECT type FROM tblservers WHERE id=\'' . $server . '\'';
$result2 = mysql_query ($query2);
$data2 = mysql_fetch_array ($result2);
$type = $data2['type'];
if (file_exists (dirname (__FILE__) . ('' . '/../modules/servers/' . $type . '/' . $type . '.php')))
{
require_once dirname (__FILE__) . ('' . '/../modules/servers/' . $type . '/' . $type . '.php');
$serverresult = serverterminateaccount ($id);
}

if ($serverresult == 'success')
{
$terminated .= '' . ' - Terminated Account: ' . $firstname . ' ' . $lastname . ' - ' . $domain . ' (Due Date: ' . $nextduedate . ')<br>';
logactivity ('' . 'Cron Job: Terminated Account (Hosting ID: ' . $id . ' - User ID: ' . $userid . ')');
++$i;
continue;
}
else
{
$terminated .= '' . ' - Manual Terminate Required: ' . $firstname . ' ' . $lastname . ' - ' . $domain . ' (Due Date: ' . $nextduedate . ')<br>';
logactivity ('' . 'Cron Job: Terminate Failed (Hosting ID: ' . $id . ' - User ID: ' . $userid . ' - Error: ' . $serverresult . ')');
continue;
}
}

$cronreport .= '' . $i . ' Accounts Terminated<br>';
if ($terminated != '')
{
$cronreport .= $terminated . '<br>';
}
else
{
$cronreport .= '<br>';
}
}

if ($CONFIG['AutoCancellationRequests'] == 'on')
{
$terminated = '';
$i = 0;
$terminatedate = date ('Ymd', mktime (0, 0, 0, date ('m'), date ('d'), date ('Y')));
$query = '' . 'SELECT * FROM tblcancelrequests INNER JOIN tblhosting ON tblhosting.id = tblcancelrequests.relid WHERE (domainstatus!=\'Terminated\' AND domainstatus!=\'Cancelled\') AND (type=\'Immediate\' OR ( type=\'End of Billing Period\' AND nextduedate<=\'' . $terminatedate . '\' ) ) ORDER BY domain ASC';
$result = mysql_query ($query);
while ($data = mysql_fetch_array ($result))
{
$id = $data['id'];
$userid = $data['userid'];
$domain = $data['domain'];
$nextduedate = $data['nextduedate'];
$server = $data['server'];
$server = $data['server'];
$regdate = frommysqldate ($regdate);
$nextduedate = frommysqldate ($nextduedate);
$query2 = '' . 'SELECT * FROM tblclients WHERE id=\'' . $userid . '\'';
$result2 = mysql_query ($query2);
$data2 = mysql_fetch_array ($result2);
$firstname = $data2['firstname'];
$lastname = $data2['lastname'];
$query2 = '' . 'SELECT type FROM tblservers WHERE id=\'' . $server . '\'';
$result2 = mysql_query ($query2);
$data2 = mysql_fetch_array ($result2);
$type = $data2['type'];
if (file_exists (dirname (__FILE__) . ('' . '/../modules/servers/' . $type . '/' . $type . '.php')))
{
require_once dirname (__FILE__) . ('' . '/../modules/servers/' . $type . '/' . $type . '.php');
$serverresult = serverterminateaccount ($id);
}

if ($serverresult == 'success')
{
$query = '' . 'UPDATE tblhosting SET domainstatus=\'Cancelled\' WHERE id=\'' . $id . '\'';
$result2 = mysql_query ($query);
$terminated .= '' . ' - Automatically Cancelled Account: ' . $firstname . ' ' . $lastname . ' - ' . $domain . ' (Due Date: ' . $nextduedate . ')<br>';
logactivity ('' . 'Cron Job: Terminated Account (Hosting ID: ' . $id . ' - User ID: ' . $userid . ')');
++$i;
continue;
}
else
{
$terminated .= '' . ' - Manual Cancellation Required: ' . $firstname . ' ' . $lastname . ' - ' . $domain . ' (Due Date: ' . $nextduedate . ')<br>';
logactivity ('' . 'Cron Job: Terminate Failed (Hosting ID: ' . $id . ' - User ID: ' . $userid . ' - Error: ' . $serverresult . ')');
continue;
}
}

$cronreport .= '' . $i . ' Cancellation Requests Automatically Processed<br>';
if ($terminated != '')
{
$cronreport .= $terminated . '<br>';
}
else
{
$cronreport .= '<br>';
}
}

if ($CONFIG['CloseInactiveTickets'] != '0')
{
$ticketsclosed = '';
$i = 0;
$query = 'SELECT * FROM tbltickets WHERE status!=\'Closed\' AND status!=\'On Hold\' AND status!=\'In Progress\'';
$result = mysql_query ($query);
while ($data = mysql_fetch_array ($result))
{
$id = $data['id'];
$subject = $data['title'];
$rawlastactivity = $data['lastreply'];
$datetime = strtotime ('NOW');
$date2 = strtotime ('' . $rawlastactivity);
$holdtotsec = $datetime - $date2;
$fulllastreply = round (($datetime - $date2) / 60 / 60, 0);
if ($CONFIG['CloseInactiveTickets'] <= $fulllastreply)
{
$query2 = '' . 'UPDATE tbltickets SET status=\'Closed\' WHERE id=\'' . $id . '\'';
$result2 = mysql_query ($query2);
$ticketsclosed .= ' - ' . $subject . '<br>';
++$i;
continue;
}
}

$cronreport .= '' . $i . ' Tickets Automatically Closed<br>';
if ($ticketsclosed != '')
{
$cronreport .= $ticketsclosed . '<br>';
}

$cronreport .= '<br>';
}

if ($CONFIG['AffiliatesDelayCommission'])
{
$affiliatepaymentscleared = 0;
$query = 'SELECT * FROM tblaffiliatespending WHERE clearingdate<=\'' . date ('Y-m-d') . '\'';
$result = mysql_query ($query);
while ($data = mysql_fetch_array ($result))
{
$affaccid = $data['affaccid'];
$amount = $data['amount'];
$query2 = '' . 'SELECT * FROM tblaffiliatesaccounts WHERE id=\'' . $affaccid . '\'';
$result2 = mysql_query ($query2);
$data = mysql_fetch_array ($result2);
$affaccid = $data['id'];
$relid = $data['relid'];
$affid = $data['affiliateid'];
$query2 = '' . 'SELECT domainstatus FROM tblhosting WHERE id=\'' . $relid . '\'';
$result2 = mysql_query ($query2);
$data = mysql_fetch_array ($result2);
$domainstatus = $data['domainstatus'];
if (($affaccid AND $domainstatus == 'Active'))
{
$query2 = '' . 'UPDATE tblaffiliates SET balance=balance+' . $amount . ' WHERE id=\'' . $affid . '\'';
$result2 = mysql_query ($query2);
$query2 = '' . 'UPDATE tblaffiliatesaccounts SET lastpaid=now() WHERE id=\'' . $affaccid . '\'';
$result2 = mysql_query ($query2);
$query2 = '' . 'INSERT INTO tblaffiliateshistory (affiliateid,date,affaccid,amount) VALUES (\'' . $affid . '\',now(),\'' . $affaccid . '\',\'' . $amount . '\')';
$result2 = mysql_query ($query2);
++$affiliatepaymentscleared;
continue;
}
}

$cronreport .= '' . $affiliatepaymentscleared . ' Pending Affiliate Payments Made<br><br>';
$query = 'DELETE FROM tblaffiliatespending WHERE clearingdate<=\'' . date ('Y-m-d') . '\'';
$result = mysql_query ($query);
}

if ($CONFIG['SendAffiliateReportMonthly'] == 'on')
{
if (date ('d') == '1')
{
$query = 'SELECT * FROM tblaffiliates';
$result = mysql_query ($query);
while ($data = mysql_fetch_array ($result))
{
$id = $data['id'];
sendmessage ('Affiliate Monthly Referrals Report', $id);
}

$cronreport .= 'Monthly Affiliate Earnings Reports Sent to Affiliates<br><br>';
}
}

if ($CONFIG['UpdateStatsAuto'] == 'on')
{
serverusageupdate ();
$cronreport .= 'Disk & Bandwidth Usage Statistics Updated';
}

if ($debug_output == 'on')
{
echo '' . '<p>' . $cronreport . '</p>';
}

$query = 'UPDATE tbldomains SET status=\'Expired\' WHERE expirydate<\'' . date ('Y-m-d') . '\' AND status=\'Active\'';
$result = mysql_query ($query);
logactivity ('Cron Job Run');
sendadminnotification ('', 'WHMCS Cron Job Activity', $cronreport);
?><?
/*
[!_!_!_ DeZendeD By MtRp - Warez-Team.Com !_!_!_ ]
*/
?>









تكفون لي اسبوعين