Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
whmcs-coza-epp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gunter Grodotzki
whmcs-coza-epp
Commits
a040123a
Commit
a040123a
authored
12 years ago
by
Nigel Kukard
Browse files
Options
Downloads
Patches
Plain Diff
Added COZA balance widget
parent
a6231955
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/widgets/cozaepp_balance.php
+95
-0
95 additions, 0 deletions
modules/widgets/cozaepp_balance.php
with
95 additions
and
0 deletions
modules/widgets/cozaepp_balance.php
0 → 100644
+
95
−
0
View file @
a040123a
<?php
# Copyright (c) 2012, AllWorldIT
#
# This program 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Official Website:
# http://devlabs.linuxassist.net/projects/whmcs-coza-epp
# Lead developer:
# Nigel Kukard <nkukard@lbsd.net>
# ! ! P L E A S E N O T E ! !
# * If you make changes to this file, please consider contributing
# anything useful back to the community. Don't be a sour prick.
# * If you find this module useful please consider making a
# donation to support modules like this.
# WHMCS hosting, theming, module development, payment gateway
# integration, customizations and consulting all available from
# http://allworldit.com
## VERSION: 0.1.0 ##
# Function to implement the cozaepp balance widget
function
widget_cozaepp_balance
(
$vars
)
{
# Setup include dir
$include_path
=
ROOTDIR
.
'/modules/registrars/cozaepp'
;
set_include_path
(
get_include_path
()
.
PATH_SEPARATOR
.
$include_path
);
require_once
'cozaepp.php'
;
# Include registrar functions aswell
require
ROOTDIR
.
'/includes/registrarfunctions.php'
;
# Grab module parameters
$params
=
getregistrarconfigoptions
(
'cozaepp'
);
$title
=
"COZA Balance"
;
# Request balance from registrar
$client
=
_cozaepp_Client
();
$output
=
$client
->
request
(
'
<epp:epp xmlns:epp="urn:ietf:params:xml:ns:epp-1.0" xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"
xmlns:cozacontact="http://co.za/epp/extensions/cozacontact-1-0">
<epp:command>
<epp:info>
<contact:info>
<contact:id>'
.
$params
[
'Username'
]
.
'</contact:id>
</contact:info>
</epp:info>
<epp:extension>
<cozacontact:info>
<cozacontact:balance>true</cozacontact:balance>
</cozacontact:info>
</epp:extension>
</epp:command>
</epp:epp>
'
);
# Parse XML result
$doc
=
new
DOMDocument
();
$doc
->
loadXML
(
$output
);
$coderes
=
$doc
->
getElementsByTagName
(
'result'
)
->
item
(
0
)
->
getAttribute
(
'code'
);
if
(
$coderes
==
'1000'
)
{
$balance
=
$doc
->
getElementsByTagName
(
'balance'
)
->
item
(
0
)
->
nodeValue
;
}
else
{
$balance
=
' - ERROR -'
;
}
$content
=
'<p align = "center" class="textblack"><strong>Current registrar balance is R '
.
$balance
.
'</strong></p>'
;
return
array
(
'title'
=>
$title
,
'content'
=>
$content
);
}
add_hook
(
"AdminHomeWidgets"
,
1
,
"widget_cozaepp_balance"
);
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment