PDA

View Full Version : Login directly to ticket system with my form.



jdlitson
02-02-2004, 01:38 AM
Hi,
I would like to know if it is possible to login to the Direct Admin ticket system through my own form.


<form method="POST" action="http://mydomain:2222/CMD_TICKET"/>


I found that it works with the default login page, which is cool but it would be more fun if I could get it working on my own form.

I appreciate your time and help -Jason

ProWebUK
02-02-2004, 07:55 AM
<form method="POST" action="http://mydomain:2222/CMD_TICKET"/>

Then add a password and username form input.... for some info click the server checklist link in my sig and look for a link to external login forms (or something similar - its there!) - theres plenty of examples on that :)

Chris

DirectAdmin Support
02-02-2004, 11:23 AM
or another way...



<form method="POST" action="http://mydomain:2222/CMD_LOGIN">
... usual login stuff ...
<input type=hidden name=referer value="http://mydomain:2222/CMD_TICKET">
</form>
:)

John

jdlitson
02-02-2004, 07:56 PM
Thank you both for your fast replies.

Edit
OOPS! Sorry this code below does not work!
It was only working because I did not log out when testing it
in FrontPage preview. Sorry if you have wasted any of your time
trying to mak it work...

Here is a complete how with html coments for beginners.

<!-- This is how an html comment is formated. -->



<!-- Direct Admin form starts here. -->

<!-- This is the line that will log your user into DA and bring them directly to the ticket system.
Change mydomain to yourdomainame.ext! -->
<form method="POST"action="http://mydomain.com:2222/CMD_TICKET">

<!-- This line is the username text box. -->
<input type="text" name="username" size="10" maxlength="26" style="font-size: 8pt" tabindex="1">

<!-- This line is the password text box. -->
<input type="password" name="password" size="8" style="font-size: 8pt" tabindex="2">

<!-- This line is the submit button The value Go > is what the user will see. -->
<input name="submit" type="submit" class="buttonstyle" style="width: 39; height: 24; font-size: 8pt" value="Go >" tabindex="3">

<!-- These next two lines are optional. -->

<!-- If the user types the wrong name or password then user will be taken to your choice of URL. -->
<input name="FAIL_URL" type="hidden" value="http://yourdomain/somepage.htm">

<!-- When the user logs out the user will be taken to your choice of URL. -->
<input name="LOGOUT_URL" type="hidden" value="http://yourdomain.com/somepage.htm">

<!-- The last line closes the form and must be included. -->
</form>

<!-- Direct Admin form ends here. -->

DirectAdmin Support
02-03-2004, 12:38 AM
Hello,

Here, try this instead :)


<!-- Direct Admin form starts here. -->

<!-- This is the line that will log your user into DA and bring them directly to the ticket system.
Change mydomain to yourdomainame.ext! -->
<form method="POST" action="http://mydomain.com:2222/CMD_LOGIN">

<!-- This line is the username text box. -->
<input type="text" name="username" size="10" maxlength="26" style="font-size: 8pt" tabindex="1">

<!-- This line is the password text box. -->
<input type="password" name="password" size="8" style="font-size: 8pt" tabindex="2">

<!-- This line is the submit button The value Go > is what the user will see. -->
<input name="submit" type="submit" class="buttonstyle" style="width: 39; height: 24; font-size: 8pt" value="Go >" tabindex="3">

<!-- These next three lines are optional. -->

<!-- If the user types the wrong name or password then user will be taken to your choice of URL. -->
<input name="FAIL_URL" type="hidden" value="http://yourdomain/somepage.htm">

<!-- When the user logs out the user will be taken to your choice of URL. -->
<input name="LOGOUT_URL" type="hidden" value="http://yourdomain.com/somepage.htm">

<!-- After a succesfull login, you will be forwarded here. If you don't specify this, you'll be sent to / -->
<input name="referer" type="hidden" value="/CMD_TICKET">

<!-- The last line closes the form and must be included. -->
</form>

<!-- Direct Admin form ends here. -->
:)
John

jdlitson
02-03-2004, 07:46 PM
Hi John,
When I add the new line of the code I get a page not
found error. I tried moving code to different positions on
the form but get the same results.

Thanks -Jason :D

DirectAdmin Support
02-04-2004, 11:17 AM
Hello,

Did you notice I also changed the CMD that the form is posted to?

John

jdlitson
02-04-2004, 10:48 PM
Hi John,
Yes, I coppied the CMD_TICKET line directly from
your post, and changed the variable to my domain name.
Does the code work for you? if it does then I must be doing
something wrong, but I worked on it for quite a while with no luck.

Thanks again for your time and help -Jason

DirectAdmin Support
02-05-2004, 12:10 PM
Hello,

Found the problem, you have to set the referer to a local path, not a full path:


<!-- After a succesfull login, you will be forwarded here. If you don't specify this, you'll be sent to / -->
<input name="referer" type="hidden" value="/CMD_TICKET">John

jdlitson
02-05-2004, 10:21 PM
Hi John,
I tried your suggestion this afternoon.
The form logged in to the / of DA and not the ticket page.

Thanks again and sorry to bother you with this -Jason :)

DirectAdmin Support
02-06-2004, 12:01 PM
Hello,

I've just edited my post above to reflect the change I suggested. Just copy that, replace all the domains with your own and it should work. I've tested it and I get forwarded to the correct place. Make sure that you've spelt "referer" the same way.

John

jdlitson
02-06-2004, 02:28 PM
Thanks for being so patient John,
It seems that FrontPage has messed something up.
My code is exactly as in your post except I have a table for my design.
When I tried the code in Dream Weaver without any tables it worked perfectly.
Everything else works when using Front Page but for some reasoned not the CMD_TICET.

Update
I have fixed this problem by making the form on a new page and then including it on my original page.

Thanks again for your help -Jason :)