Jump to content
Sign in to follow this  
Doctrine

Directadmin module Bug

Recommended Posts

Hello

Got this error:

An internal error occurred, or the server did not respond to the request.

Latest directadmin, latest Blesta, packages created without any problem, i could check the user package, server IP. But i cannot suspend users for example. Seems everything is configured correctly.

Input:

Quote

s1.servername.eu|suspendUser
s:5:"username";

Here is the output from the module:

Quote

 

s1.servername.eu
a:1:{s:42:"<html>
____<head>
________<meta_http-equiv";s:1094:""Content-Type" content="text/html; charset=utf-8;"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        
        <title>DirectAdmin Login</title>
        
        <link rel="shortcut icon" href="/images/favicon.png" type="image/x-icon" />

        <meta name="robots" content="noindex,nofollow" />
        <script>
            var tokens = {
                LOST_PASSWORD: "no" === "yes",
                TIME: {
                    current: 1520711641 * 1000,
                    offset: 172800 * 1000,
                },                
            };
        </script>
    </head>
    <body>
        <!-- Vue root -->
        <div id="login"></div>
        <div id="foot" style="display:none;">
            <script type="text/javascript" src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default-3.4"></script>            
            <script type="text/javascript" src="/assets/vendors.js?ver=|SKIN_VERSION|"></script>
            <script type="text/javascript" src="/assets/login.js?ver=|SKIN_VERSION|"></script>
        </div>
    </body>
</html>

 

 

Any suggestion? I use the default Directadmin Theme...

Got this issue on multiple server.. on multiple company.

Share this post


Link to post
Share on other sites
On 3/10/2018 at 3:57 PM, Doctrine said:

Hello

Got this error:

An internal error occurred, or the server did not respond to the request.

Latest directadmin, latest Blesta, packages created without any problem, i could check the user package, server IP. But i cannot suspend users for example. Seems everything is configured correctly.

Input:

Here is the output from the module:

 

Any suggestion? I use the default Directadmin Theme...

Got this issue on multiple server.. on multiple company.

looks like a api issue, possibly just needs to be patched to support any newer api directadmin is using maybe?

since usually api's aren't supposed to output html like that.

I can try patching it for you and post it here for you, though do note I don't use directadmin and therefore won't be able to test it for you, since at best would be following directadmin's api guides and hope it works.

after further investigation it looks like it isn't logging into directadmin api as seen by this header?

 <title>DirectAdmin Login</title>

 

Share this post


Link to post
Share on other sites

If you haven't resolved this issue yet, you may want to contact DirectAdmin support for help. The module POSTs a suspension via the API command CMD_API_SELECT_USERS, with a location set to CMD_SELECT_USERS. Normally, this would suspend the user in DirectAdmin and respond back to Blesta that there was no error performing this action, however, the DirectAdmin API returned an invalid HTML response that is not expected for that end point, which leads me to believe that the DirectAdmin API or or its configuration has gone awry.

Share this post


Link to post
Share on other sites
On 3/14/2018 at 2:28 PM, Tyson said:

If you haven't resolved this issue yet, you may want to contact DirectAdmin support for help. The module POSTs a suspension via the API command CMD_API_SELECT_USERS, with a location set to CMD_SELECT_USERS. Normally, this would suspend the user in DirectAdmin and respond back to Blesta that there was no error performing this action, however, the DirectAdmin API returned an invalid HTML response that is not expected for that end point, which leads me to believe that the DirectAdmin API or or its configuration has gone awry.

read the below, it shows why that isn't the correct command.

Share this post


Link to post
Share on other sites
On 2018. 03. 14. at 7:28 PM, Tyson said:

If you haven't resolved this issue yet, you may want to contact DirectAdmin support for help. The module POSTs a suspension via the API command CMD_API_SELECT_USERS, with a location set to CMD_SELECT_USERS. Normally, this would suspend the user in DirectAdmin and respond back to Blesta that there was no error performing this action, however, the DirectAdmin API returned an invalid HTML response that is not expected for that end point, which leads me to believe that the DirectAdmin API or or its configuration has gone awry.

User creation is working without any problem. Strange thing

Share this post


Link to post
Share on other sites
6 hours ago, Doctrine said:

User creation is working without any problem. Strange thing

I fixed the bug by doing this in direct_admin_api.php:

'suspendUser' =>
			array('POST','','CMD_API_SELECT_USERS',array('suspend'=>'Suspend','location'=>'CMD_API_SELECT_USERS')),
		'unsuspendUser' =>
			array('POST','','CMD_API_SELECT_USERS',array('suspend'=>'Unsuspend','location'=>'CMD_API_SELECT_USERS')),

from:

'suspendUser' =>
			array('POST','','CMD_API_SELECT_USERS',array('suspend'=>'Suspend','location'=>'CMD_SELECT_USERS')),
		'unsuspendUser' =>
			array('POST','','CMD_API_SELECT_USERS',array('suspend'=>'Unsuspend','location'=>'CMD_SELECT_USERS')),

that was likely a oversight on the blesta dev's part but is actually easily to fix as shown above, since directadmin's api information here:

http://www.directadmin.com/features.php?id=807

states the default CMD_SELECT_USERS will not return the standard json api response like the module is expecting, CMD_API_SELECT_USERS does return the standard json api response and therefore it works finally, tried to find the module on github to submit a pull request to apply this patch to module but didn't find it so thought would just post it here instead.

EGcXLr.jpg

wLjUH9.jpg

thanks to @Doctrine for providing the directadmin panel to patch the issue and make sure it works.

information redacted for security reasons.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×