Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Podpięcie pod tworzenie emaila Direct Admin
furman12
post
Post #1





Grupa: Zarejestrowani
Postów: 118
Pomógł: 4
Dołączył: 3.12.2009

Ostrzeżenie: (0%)
-----


Witam,
Jak podpiąć się pod Direct Admina v 1.34.5 aby skryptem móc tworzyć emaile??

W ogóle jest to możliwe? Czy będę musiał tworzyć konta email ręcznie jak ktoś poprosi?

Ten post edytował furman12 6.02.2010, 16:36:20
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
CapaciousCore
post
Post #2





Grupa: Zarejestrowani
Postów: 30
Pomógł: 4
Dołączył: 28.09.2009
Skąd: Chełm

Ostrzeżenie: (0%)
-----


Bez obrazy ale wszystko jest mozliwe o ile ma sie takie umiejetnosci. Tworzyc emaile w Twojej definicji oznacza co? Chcesz automatem tworzyc jakies konta mailowe?
Go to the top of the page
+Quote Post
furman12
post
Post #3





Grupa: Zarejestrowani
Postów: 118
Pomógł: 4
Dołączył: 3.12.2009

Ostrzeżenie: (0%)
-----


Chce aby uprawniony user na portalu sam sobie zrobił jeśli potrzebuje

Może zaczne od początku. Mam sobie konto hostingowe z nielimitowaną liczbą emaili. Chce aby user mógł sobie stworzyć email w mojej domenie. Ja mogę dodawać emaile poprzez direct admina, a mają to robić userzy poprzez zewnętrzny formularz. Nie chodzi o gotowiec chociaż miło by było, ale moglibyście mnie pokierować na dobrą droge.
Go to the top of the page
+Quote Post
XianN
post
Post #4





Grupa: Zarejestrowani
Postów: 57
Pomógł: 9
Dołączył: 12.11.2005
Skąd: ze wnowu?!

Ostrzeżenie: (0%)
-----


DirectAdmin Web Control API - sa przyklady, klasa w PHP itd.
Go to the top of the page
+Quote Post
furman12
post
Post #5





Grupa: Zarejestrowani
Postów: 118
Pomógł: 4
Dołączył: 3.12.2009

Ostrzeżenie: (0%)
-----


Zrobiłem coś takiego ale nie działa. Nie mam raportowania błędów więc nie wiem dlaczego. Help!
  1. <?
  2.  
  3. $server_ip="ip";
  4. $server_login="login";
  5. $server_pass="haslo";
  6. $server_ssl="N";
  7.  
  8.  
  9. $user=$_POST['username'];
  10. $domain=$_POST['domain'];
  11. $pass=$_POST['pass'];
  12. $quota=$_POST['quota'];
  13.  
  14.  
  15. if (isset($_POST['action']) && $_POST['action'] == "add")
  16. {
  17.  
  18. echo "Creating user" . $user . " on server " . $ip . ".... <br>\n";
  19.  
  20. $sock = new HTTPSocket;
  21. if ($server_ssl == 'Y')
  22. {
  23. $sock->connect("ssl://".$server_ip, 2222);
  24. }
  25. else
  26. {
  27. $sock->connect($server_ip, 2222);
  28. }
  29.  
  30. $sock->set_login($server_login,$server_pass);
  31.  
  32. $sock->query('/CMD_API_POP',
  33. 'action' => 'create',
  34. 'user' => $user,
  35. 'passwd' => $pass,
  36. 'domain' => $domain,
  37. 'quota' => $quota,
  38. ));
  39.  
  40. $result = $sock->fetch_parsed_body();
  41.  
  42. if ($result['error'] != "0")
  43. {
  44. echo "<b>Error Creating user " . $username on server" . $server_ip . ":<br>\n";
  45. echo $result['text'] . "<br>\n";
  46. echo $result['details'] . "<br></b>\n";
  47. }
  48. else
  49. {
  50. echo "User" . $username . " created on server " . $server_ip . "<br>\n";
  51. }
  52.  
  53. exit 0;
  54. }
  55.  
  56. ?>
  57.  
  58.  
  59. <form action="" method="POST">
  60. <input type="hidden" name=action value="add" />
  61. Username: <input type="text" name="username" /><br>
  62. Domain:<input type="text" name="domain" /><br>
  63. Pass: <input type="password" name="pass" /><br>
  64. Quota: <input type="text" name="quota" /><br>
  65. </form>


Poprawiłem i na innym serwerze działa. Czy to może być wina serwera?
  1. <?
  2.  
  3. $server_ip="ip";
  4. $server_login="login";
  5. $server_pass="haslo";
  6. $server_ssl="N";
  7.  
  8.  
  9. $user=$_POST['username'];
  10. $domain=$_POST['domain'];
  11. $pass=$_POST['pass'];
  12. $quota=$_POST['quota'];
  13.  
  14.  
  15. if (isset($_POST['action']) && $_POST['action'] == "add")
  16. {
  17.  
  18. echo "Creating user" . $user . " on server " . $ip . ".... <br>\n";
  19.  
  20. $sock = new HTTPSocket;
  21. if ($server_ssl == 'Y')
  22. {
  23. $sock->connect("ssl://".$server_ip, 2222);
  24. }
  25. else
  26. {
  27. $sock->connect($server_ip, 2222);
  28. }
  29.  
  30. $sock->set_login($server_login,$server_pass);
  31.  
  32. $sock->query('/CMD_API_POP',
  33. 'action' => 'create',
  34. 'user' => $username,
  35. 'passwd' => $pass,
  36. 'domain' => $domain,
  37. 'quota' => $quota,
  38. ));
  39.  
  40. $result = $sock->fetch_parsed_body();
  41.  
  42. if ($result['error'] != "0")
  43. {
  44. echo "<b>Error Creating user " . $username . " on server" . $server_ip . ":<br>\n";
  45. echo $result['text'] . "<br>\n";
  46. echo $result['details'] . "<br></b>\n";
  47. }
  48. else
  49. {
  50. echo "User" . $username . " created on server " . $server_ip . "<br>\n";
  51. }
  52.  
  53. exit(0);
  54. }
  55.  
  56. ?>
  57.  
  58.  
  59. <form action="" method="POST">
  60. <input type="hidden" name="action" value="add" />
  61. Username: <input type="text" name="username" /><br>
  62. Domain:<input type="text" name="domain" /><br>
  63. Pass: <input type="password" name="pass" /><br>
  64. Quota: <input type="text" name="quota" /><br>
  65. </form>


Ok już wiem dlaczego nie ruszało. Brakowało includa do tego pliku. Ale i tak dobrze nie działa. Skrypt zwraca swojego errora.

Problem rozwiązany zmienna $username powinnabyć zmieniona na $user.

Proszę administratora o zamknięcie.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.12.2025 - 00:04