FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
whmcs/pointer/pointerdomaingrsync.php at master · pointergr/whmcs · GitHub
pointergr
/
whmcs
Public
Notifications
You must be signed in to change notification settings
Fork
3
Star
3
Code
Issues
0
Pull requests
1
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
whmcs
/
pointer
/
pointerdomaingrsync.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
67 lines (59 loc) · 2.66 KB
Breadcrumbs
whmcs
/
pointer
/
pointerdomaingrsync.php
Copy path
File metadata and controls
67 lines (59 loc) · 2.66 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
include_once
(
"
../../../dbconnect.php
"
);
include_once
(
"
../../../includes/functions.php
"
);
include_once
(
"
../../../includes/registrarfunctions.php
"
);
include_once
(
dirname
(
__FILE__
) .
"
/pointer.php
"
);
$
cronreport
=
"
Pointer Domain Sync Report<br>
\n
---------------------------------------------------<br>
\n"
;
$
params
=
getRegistrarConfigOptions
(
"
pointer
"
);
$
username
=
$
params
[
'
Username
'
];
$
password
=
$
params
[
'
Password
'
];
$
testmode
=
$
params
[
"
TestMode
"
];
date_default_timezone_set
(
'
UTC
'
);
$
url
=
false
;
if
(
$
testmode
==
'
on
'
||
$
testmode
==
1
) {
$
url
=
"
http://devpointer.ngrok.com/admin/reseller
"
;
}
else
{
$
url
=
"
https://www.pointer.gr/api
"
;
}
$
resp
=
call_user_func_array
(
'
login
'
,
array
(
$
username
,
$
password
,
$
url
));
if
(
$
resp
[
'
code
'
] !=
'
200
'
) {
$
cronreport
.=
"
Error
"
.
$
resp
[
'
code
'
] .
"
"
.
$
resp
[
'
message
'
] .
"
<br>
\n"
;
}
else
{
$
queryresult
=
mysql_query
(
"
SELECT * FROM `pointer_domain` WHERE `queued_on` <
"
.
time
());
$
key
=
$
resp
[
'
key
'
];
while
(
$
data
=
mysql_fetch_array
(
$
queryresult
)) {
$
domainname
=
$
data
[
'
domain
'
];
$
args
=
array
();
$
args
[
'
domain
'
] =
$
domainname
;
$
args
[
"
Username
"
] =
$
username
;
$
args
[
"
Password
"
] =
$
password
;
$
args
[
'
action
'
] =
$
data
[
'
action
'
];
$
args
[
'
key
'
] =
$
key
;
$
args
[
'
url
'
] =
$
url
;
$
tries
=
$
data
[
'
tries
'
];
$
resp
=
call_user_func_array
(
'
getExpireDate
'
,
array
(
$
args
));
if
(
$
resp
[
'
code
'
] !=
'
200
'
|| !
isset
(
$
resp
[
'
expire_date
'
])) {
$
tries
++;
$
cronreport
.=
"
Error for
{
$
domainname
}
:
"
.
$
resp
[
'
code
'
] .
"
"
.
$
resp
[
'
message
'
] .
"
<br>
\n"
;
if
(
$
tries
<
4
) {
$
sql_string
=
"
UPDATE `pointer_domain` SET `queued_on` =
"
. (
time
() +
86400
) .
"
, `tries`=
{
$
tries
}
WHERE `domain` = '
{
$
domainname
}
'
"
;
}
else
{
$
sql_string
=
"
DELETE FROM `pointer_domain` WHERE `domain` = '
{
$
domainname
}
'
"
;
}
mysql_query
(
$
sql_string
);
}
else
{
$
date
=
date
(
'
Y-m-d
'
,
$
resp
[
'
expire_date
'
]);
$
queryresult
=
mysql_query
(
"
UPDATE `tbldomains` SET `expirydate` = '
{
$
date
}
' WHERE `domain` = '
{
$
domainname
}
'
"
);
if
(!
$
queryresult
) {
$
cronreport
.=
"
Error
"
.
mysql_error
() .
"
<br>
\n"
;
}
else
{
$
cronreport
.=
"
Updated
{
$
domainname
}
expiry to
"
.
$
date
.
"
<br>
\n"
;
$
sql_string
=
"
DELETE FROM `pointer_domain` WHERE `domain` = '
{
$
domainname
}
'
"
;
mysql_query
(
$
sql_string
);
}
}
}
}
sendAdminNotification
(
"
system
"
,
"
WHMCS Pointer Domain Syncronisation Report
"
,
$
cronreport
);
$
resp
=
call_user_func_array
(
'
logout
'
,
array
(
$
username
,
$
password
,
$
url
,
$
key
));
?>
Back
|
FazBrowse Home
|
New Git URL