Jump to content
[MUST READ] Forum Rules ×

Frajola

Members
  • Posts

    5
  • Joined

  • Last visited

About Frajola

  • Birthday 03/11/1998

Recent Profile Visitors

608 profile views

Frajola's Achievements

Newbie

Newbie (1/14)

  1. Yeah, it uses POP, if its not enabled is there any method to authenticate to VistaPanel through my website? Because if so I might be able to do something, but I don't believe it is possible, because accessing through the IP adress to the panel: https://185.27.134.3/ , it doesn't allow to login, just returns the error: "It appears you are accessing the panel from an invalid address". Thanks everyone for trying to help, I believe its easier to continue creating the email accounts mannually haha.
  2. This is the code I've used with cPanel this is the create.php <?php function pop3create($email,$senha,$quota) { $host = "localhost"; $logincpanel="PANEL USER"; // cPanel Login $senhacpanel="PANEL PASSWORD"; // cPanel Password $socket = fsockopen($host,2082); socket_set_timeout($socket,30); $authstr = "$logincpanel:$senhacpanel"; $pass = base64_encode($authstr); $in = "GET / HTTP/1.0\r\nAuthorization: Basic $pass \r\n\r\n"; fputs($socket,$in); $resposta=array(); while (!feof($socket)) { $resposta[] = htmlspecialchars(fgets($socket, 128)); } fclose( $socket ); $checa = strpos($resposta[6],"The Document has moved here"); if ($checa != false) { //if logged successfully $redir = trim(str_replace("Location: ","",$resposta[3])); $redir = str_replace(substr($redir,-10),"mailcentral/doaddpop.html",$redir); $socket = fsockopen($host,2082); socket_set_timeout($socket,30); $split = split("@",$email); $loginemail = $split[0]; $dominioemail = $split[1]; $in = "GET $redir?email=$loginemail&domain=$dominioemail&password=$senha&quota=$quota HTTP/1.0\r\nAuthorization: Basic $pass \r\n\r\n"; fputs($socket,$in); while (!feof($socket)) { $resto .= htmlspecialchars(fgets($socket, 128)); } fclose( $socket ); $parametro = $loginemail."+".$dominioemail; $checa = strpos($resto,$parametro); if ($checa != false) { return 1; } else { return 2; } } else { echo "cPanel connection refused"; } } $criaconta = pop3create("$loginemail@$dominioemail","$senha","$quota"); if ($criaconta == 1) { echo "Success...<br><br>your email is: $loginemail@$dominioemail"; } if ($criaconta == 2) { echo "Account already exists"; } ?> and this is the form code <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Criando seu e-mail!</title> <style type="text/css"> <!-- .style1 { font-family: Verdana; font-size: 12px; } .style11 {font-family: Verdana; font-size: 10px; } .style12 {font-size: 10px} --> </style> </head> <body> <table width="500" align="center"> <tr> <td align="center" valign="middle"><span class="style1">Create email</span></td> </tr> <tr> <td>&nbsp;</td> </tr> <tr> <td><form name="form1" method="post" action="create.php"><table width="500"> <tr> <td><span class="style12"></span></td> <td><span class="style12"></span></td> </tr> <tr> <td><span class="style11">Login:</span></td> <td> <input name="loginemail" type="text" id="loginemail"> </td> </tr> <tr> <td><span class="style11">Senha:</span></td> <td><input name="senha" type="text" id="senha"></td> </tr> <tr> <td><span class="style12"></span></td> <td><span class="style11"> <input name="dominioemail" type="hidden" id="dominioemail" value="domain.here"><!-- COLOQUE AQUI O SEU DOMINIO --> <input name="quota" type="hidden" id="quota" value="5"> </span></td> </tr> <tr> <td><span class="style12"></span></td> <td><input name="Submit" type="submit" value="Enviar!"></td> </tr> <tr> <td><span class="style12"></span></td> <td><span class="style12"></span></td> </tr> </table></form></td> </tr> </table> </body> </html>
  3. Almost, I just want to integrate this function to a Website I'm working on, it wouldn't be tottaly oppened to the public. That's ok, I'm trying to work in a solution as well, but no success so far, I appreciate the effort.
  4. Hello everyone, I'd like some help to create a form for creating an email from a page of my website, first of all, is it possible with VistaPanel? I've done that before with cPanel, but the authorization method is diferent in VistaPanel, and I can't connect the script I've got with VP. Can someone help me? Thanks!
×
×
  • Create New...