Page 2 of 19 FirstFirst 123412 ... LastLast
Results 21 to 40 of 369

Thread: PHP class for communicating with DA

  1. #21
    Join Date
    Nov 2003
    Location
    Germany / Rheine
    Posts
    14
    Hello,

    there is a big problem with the new html safe characters feature in version 1.203.

    The "parse_str" PHP Function will not work together with the unicode html characters.... :-(

    Benny

    ---
    Linuworx.de
    Last edited by dryas; 12-05-2003 at 01:45 PM.

  2. #22
    Ok, I'll have a look and make sure it works for 1.20.4

    John

  3. #23
    Join Date
    Nov 2003
    Location
    Germany / Rheine
    Posts
    14
    Hi,

    sorry, but this feature is terrible. Nothing against html safe characters, but it blocks any php or perl script.

    If you use &#[NUMBER], PHP didn't work, because it misinterprets the GET Variables. If you use %[NUMBER] Perl will make problems...

    The %[NUMBER] works with PHP, but this is not HTML safe, isn't it? I must search and replace all the characters all the time...

    Out of the frying pan into the fire...

    Benny
    Last edited by dryas; 12-09-2003 at 12:36 PM.
    Linuworx.de GbR
    http://www.linuworx.de | bkaiser@linuworx.de

  4. #24
    Join Date
    Jun 2003
    Posts
    1,471
    Just escape = and & somehow, with some character sequence, or something. Nothing else is needed.

    = -> |EQL|
    & -> |AMP|

    or something.

    With the class I can easily convert these back to = and &.
    Installatron Plugin is a native DirectAdmin plugin that provides you and your customers an intuitive interface to install, manage, upgrade, and backup/restore a premier collection of the best applications on the web, all instantly at the click of a button.

    Also: cPanel-to-DA converterBulk Domains and Sub-domain PluginDA User Tool

  5. #25
    Hello,

    The proper version was released 4 days ago Just upgrade to 1.20.4. It uses the proper %?? instead of &#??.

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

    John

  6. #26
    Join Date
    Jun 2003
    Posts
    1,471
    Ah, yes. For some reason I was under the impression this still wasn't fixed. Sorry
    Installatron Plugin is a native DirectAdmin plugin that provides you and your customers an intuitive interface to install, manage, upgrade, and backup/restore a premier collection of the best applications on the web, all instantly at the click of a button.

    Also: cPanel-to-DA converterBulk Domains and Sub-domain PluginDA User Tool

  7. #27
    Join Date
    Oct 2003
    Posts
    9

    ERROR

    Hi,

    Every time I try to use this, it tells me:

    Could not excute your request



    Details
    You do not own that domain

    Would anyone know why that is?

  8. #28
    Join Date
    Jun 2003
    Posts
    1,471
    Check and make sure you're using the admin|{username} // {admin_password} login format
    Installatron Plugin is a native DirectAdmin plugin that provides you and your customers an intuitive interface to install, manage, upgrade, and backup/restore a premier collection of the best applications on the web, all instantly at the click of a button.

    Also: cPanel-to-DA converterBulk Domains and Sub-domain PluginDA User Tool

  9. #29
    Join Date
    Oct 2003
    Posts
    9
    I found what was wrong!

    In the examples, it showed the domain name to be inside {}, apparently, the {} are not needed. After I took those out, it worked fine.

    This is what I'm talking about:


    <?php

    include 'httpsocket.php';

    $sock = new HTTPSocket;

    $sock->connect('comain.com',2222);
    $sock->set_login('username,'************');

    $sock->set_method('POST');

    $sock->query('/CMD_EMAIL_POP',
    array(
    'action' => 'create',
    'domain' => 'domain.com', //NOT '{domain.com}'
    'user' => 'start',
    'passwd' => 'pass',
    'passwd2' => 'pass',
    'create' => 'Create'
    ));
    $result = $sock->fetch_body();

    echo $result;

    ?>

  10. #30
    Join Date
    Oct 2003
    Posts
    9

    QUESTION

    I have a Question though...

    How can you set it so that after, lets say, the POP account has been created, the default header (Log Out, Change Password, Help, buttons, and on the left, the DA Logo, and the tree) don't show up?

    The links are broken anyways, which I guess is good cuz noone wants visitors to be able to do anything after creating their Email account...

  11. #31
    Join Date
    Jun 2003
    Posts
    1,471
    Originally posted by lidios
    In the examples, it showed the domain name to be inside {}, apparently, the {} are not needed. After I took those out, it worked fine.
    Yeah, sorry, I use them to show you need to insert something. Maybe using $whatever inplace of {whatever} would be better.
    Originally posted by lidios
    How can you set it so that after, lets say, the POP account has been created, the default header (Log Out, Change Password, Help, buttons, and on the left, the DA Logo, and the tree) don't show up?
    You're going to have to regex the body result and cut out anything you don't want.

    Remember, any CMD_API* token will return a pretty result that this php class can parse. It's the other tokens that end up returning their in-DA HTML values.
    Last edited by l0rdphi1; 02-28-2004 at 08:57 AM.
    Installatron Plugin is a native DirectAdmin plugin that provides you and your customers an intuitive interface to install, manage, upgrade, and backup/restore a premier collection of the best applications on the web, all instantly at the click of a button.

    Also: cPanel-to-DA converterBulk Domains and Sub-domain PluginDA User Tool

  12. #32
    Join Date
    Feb 2004
    Location
    Sweden
    Posts
    36
    I have just tried to use the finished example of the CMD_DOMAIN script from l0rdphi1.

    I change the login and password, servername and what the domain it should create.

    Run the script and end up on the login page, nothing seems to be runned.

    No errors?

    Creating a user works fine but i want to be able to create a second domain with CMD_DOMAIN (which isn't in the API list).

    /Best Regards
    Marcus

  13. #33
    Join Date
    Jun 2003
    Posts
    1,471
    Can you reply with the code you're using? (minus your password )
    Installatron Plugin is a native DirectAdmin plugin that provides you and your customers an intuitive interface to install, manage, upgrade, and backup/restore a premier collection of the best applications on the web, all instantly at the click of a button.

    Also: cPanel-to-DA converterBulk Domains and Sub-domain PluginDA User Tool

  14. #34
    Join Date
    Feb 2004
    Location
    Sweden
    Posts
    36
    PHP Code:
    <?php

    include 'httpsocket.php';

    $sock = new HTTPSocket;
    $sock->connect('ssl://ipadress',2222);

    $sock->set_login("admin|web270","notforyou!");

    $sock->set_method('POST');

    $sock->query('/CMD_DOMAIN',
        array(
            
    'action' => 'create',
            
    'domain' => 'kalletestar.se',
            
    'ubandwidth' => 'unlimited',
            
    'uquota' => 'unlimited',
            
    'ssl' => 'OFF',
            
    'cgi' => 'ON',
            
    'php' => 'ON',
            
    'create' => 'Create'
        
    ));
    $result $sock->fetch_body();

    echo 
    $result;

    ?>
    There it is!

  15. #35
    Join Date
    Jun 2003
    Posts
    1,471
    Hmmmm. You are using your 'admin' user password, correct? Besides the SSL connection (which people have been having trouble with), that looks like it should work without any problems. Are you sure your PHP configuration is set up to handle ssl:// includes in PHP? (I'd guess it is, though)
    Installatron Plugin is a native DirectAdmin plugin that provides you and your customers an intuitive interface to install, manage, upgrade, and backup/restore a premier collection of the best applications on the web, all instantly at the click of a button.

    Also: cPanel-to-DA converterBulk Domains and Sub-domain PluginDA User Tool

  16. #36
    Join Date
    Feb 2004
    Location
    Sweden
    Posts
    36
    Solved!

    Used the wrong password.

    One shall not work on mondays!

    /Marcus
    Last edited by Marckus_e; 03-08-2004 at 05:40 AM.

  17. #37
    Join Date
    Mar 2004
    Posts
    23

    Talking Question

    OKe,

    I'm new with this so bare with me

    Oke I have a reseller account with a certain hostingcompany... Created a new user with a own domain, where I want to automatically, with the help of PHP, create new subdomains and emailaccounts.

    for example:

    'mydomain.com' is the account, with 'test' as username and 'rain' as password
    And I want to create the next examples:

    test.mydomain.com

    and

    test@mydomain.com


    Well the email part worked with me, by using the virtual email commands : /CMD_API_POP

    The username + password I used for that command were the username and password of the 'mydomain.com' account (created under 'Your Reseller').

    But the listing and creation of subdomains, doesn't work with me. I will c&p an example where I was trying to print a list of already existing subdomains:

    PHP Code:
    $sock = new HTTPSocket;  
    $sock->connect("<my IP>",<my Port>); 
    $sock->set_login("test","rain");$sock->query('/CMD_API_SUBDOMAINS', array('domain' => 'mydomain.com'));    

    $result $sock->fetch_parsed_body();  
    print_r($result); 

    What am I doing wrong

  18. #38
    Join Date
    Mar 2004
    Posts
    23

    Lightbulb Aaaahhh

    A little bit of reading explains a LOT

    oke they are running 1.21.0 and the commands I try to use are implements in 1.21.2 -> figures...

    So I'll just bug those guys, if the want to upgrade...

    I'll be back

  19. #39
    Join Date
    Mar 2004
    Posts
    23

    Next Question ;)

    Oke next question... I can do almost everything:

    create subdomains
    create databases
    create emailboxes

    and get lists of all the options above.

    BUT is it also possible to create FTP accounts (under the subdomain)? I can't find anything about it in the API, but I've to admit, I'm a really bad reader as well as a writer

    So is FTP control something I overlooked or just not present... and where can I request such a API extention Because if I'm getting it right "l0rdphi1" is the PHP code master, but not the DA developer, that's John isn't it?

    Greetz

  20. #40
    Hello,

    Anything you can do via webbrowser can be done via the API. The only difference is that you might not get a parseable result, but the command will be executed. Just load the desired page in your web browser, go "view source" and retrieve all form values for the command you want and apply them to your script.

    John

Page 2 of 19 FirstFirst 123412 ... LastLast

Similar Threads

  1. DA PHP Class with DA API Functions
    By DJVG in forum Scripting / API
    Replies: 14
    Last Post: 01-17-2012, 02:49 PM
  2. different nameserver for each Class C
    By gtgart in forum DNS
    Replies: 2
    Last Post: 11-20-2008, 03:50 PM
  3. Ruby API Class
    By voxxitdesigns in forum Scripting / API
    Replies: 21
    Last Post: 07-31-2008, 07:52 PM
  4. JAVA class for communicating with DA
    By gpfault in forum Scripting / API
    Replies: 0
    Last Post: 03-31-2005, 06:59 PM
  5. Da+php+da Class
    By fusionictnl in forum General Technical Discussion & Troubleshooting
    Replies: 0
    Last Post: 10-27-2004, 02:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •