Welcome Guest, Not a member yet? Register   Sign In
Cpanel API Bug With Code Ignitor?
#1

[eluser]smatakajr[/eluser]
Hey

OK Im bugging out here... Im using codeigntor 1.7.1
This is the out put from IDENTICAL calls

This one is calling within a library file ADDED (XXXX) for security

FAILED!

Array
(
[0] => Array
(
[cpanel_xmlapi_user] => cointsite
[cpanel_xmlapi_module] => Mysql
[cpanel_xmlapi_func] => adddb
[cpanel_xmlapi_apiversion] => 1
)

[1] => http://mydomain.com:2082/xml-api/cpanel
[2] => Authentication Header: Authorization: Basic Y29pbnRzaXRlOXXXXd2tjTFE3ZUR1

[3] => RESPONSE:
<cpanelresult>
<data>
<result>0</result>
<reason>Access denied</reason>
</data>
</cpanelresult>

)
1

This one here is called from a controller

SUCCESS

Array
(
[0] => Array
(
[cpanel_xmlapi_user] => coinsite
[cpanel_xmlapi_module] => Mysql
[cpanel_xmlapi_func] => adddb
[cpanel_xmlapi_apiversion] => 1
)

[1] => http://mydomain.com:2082/xml-api/cpanel
[2] => Authentication Header: Authorization: Basic Y29pbnNpdGU6YW5XXXXZ3a2NMUTdlRHU=


[3] => RESPONSE:
&lt;?xml version="1.0" ?&gt;
<cpanelresult><module>Mysql</module><func>adddb</func><type>event</type><source>internal</source><apiversion>1</apiversion><data><result></result></data> <event>
<result>1</result>
</event>
</cpanelresult>
)


I have double checked BOTH base64_encode with
http://www.opinionatedgeek.com/dotnet/to...e64decode/

And they validate.. the only difference infact is the base64_encode string
The one from the controller WORKS the one from inside the library fails

I have also looked into Code Ignitor to see if there is a modified behavior and
I cannot find anything...

I have also did a var_dump() on the object and it has all the correct info
its the same exact call, just ones in a controller and ones in a library


Im really at a loss here hoping someone has a clue

Thanks
Ricky
#2

[eluser]smatakajr[/eluser]
OK hope this helps somebody here.. AFTER 8 friggin hours of debugging today
I finally figured out the problem

In the controller I had HARD CODED the password
In the library I had decoded the password. From the encryption stored in the DB

So However that was decoded from CI encryption class.. that was the damn issue!!

I cant belive that man... maybee there is a fix for this.. i dunno .. im afraid
to update to CI 2 because i have lots of code in CI 1.7.1 working flaswlessly

Thanks
Ricky




Theme © iAndrew 2016 - Forum software by © MyBB