Jump to content

Recapcha Cpanel Webmail Registration System


JamieLyons

Recommended Posts

Code i have:

<?php


include("./xmlapi.php");   //XMLAPI cpanel client class

// Default whm/cpanel account info

$ip = "localhost";           // should be WHM ip address
$account = "<Notsaying>";        // cpanel user account name
$passwd ="<obviouslynotsaying>";        // cpanel user password
$port =2082;                 // cpanel secure authentication port unsecure port# 2082

$email_domain = '<secret>'; // email domain (usually same as cPanel domain)
$email_quota = 1024; // default amount of space in megabytes


/*************End of Setting***********************/

function getVar($name, $def = '') {
  if (isset($_REQUEST[$name]))
    return $_REQUEST[$name];
  else 
    return $def;
}
// check if overrides passed
$email_user = getVar('user', '');
$email_pass = getVar('pass', $passwd);
$email_vpass = getVar('vpass', $vpasswd);
$email_domain = getVar('domain', $email_domain);
$email_quota = getVar('quota', $email_quota);

$msg = '';
if (!empty($email_user))
while(true) {


if ($email_pass !== $email_vpass){       //check password
$msg = "Email passwords don't match";
break;
}

$xmlapi = new xmlapi($ip);

$xmlapi->set_port($port);  //set port number. cpanel client class allow you to access WHM as well using WHM port.

$xmlapi->password_auth($account, $passwd);   // authorization with password. not as secure as hash.

// cpanel email addpop function Parameters
$call = array(domain=>$email_domain, email=>$email_user, password=>$email_pass, quota=>$email_quota);

$xmlapi->set_debug(0);      //output to error file  set to 1 to see error_log.

$result = $xmlapi->api2_query($account, "Email", "addpop", $call ); // making call to cpanel api

//for debugging purposes. uncomment to see output
//echo 'Result\n<pre>';
//print_r($result);  
//echo '</pre>';

if ($result->data->result == 1){
$msg = $email_user.'@'.$email_domain.' account created';

} else {
$msg = $result->data->reason;
  break;
}

break;
}

?>

<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Fr00t Mail - Login</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="bootstrap/css/bootstrap.css" rel="stylesheet">

    <link href="css/flat-ui.css" rel="stylesheet">

    <link rel="shortcut icon" href="images/favicon.ico">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
      <script src="js/html5shiv.js"></script>
    <![endif]-->
  </head>
  <body>
    <div class="container">
      <div class="login">
        <div class="login-screen">
          <div class="login-icon">
            <img src="images/login/icon.png" alt="Welcome to Fr00t Mail" />
            <h4>Welcome to <small><name> Mail</small></h4>
          </div>

          <div class="login-form">
            <div class="control-group">
			 <form name="frmEmail" method="post">
              <input type="text" class="login-field" name="user" value="" placeholder="Enter your Desired E-Mail" id="email" /><br>
<div>

            <div class="control-group">
              <input type="password" class="login-field" name="pass" value="" placeholder="Password" id="password" />
</div>
			<div class="control-group">
			  <input type="password" class="login-field" name="vpass" value="" placeholder="Verify Password" id="vpass" />
            <input type="submit" name="submit" value="Register" class="btn btn-primary btn-large btn-block"></a><br>
            <h4><small>Remember, do not put @<secret>.com</small></h4><br><h4><small><br><?php echo $msg ?></small></h4>
			</form>
          </div>
		 </div>
        </div>
      </div>
    </div> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    <script type="text/javascript"><!--
google_ad_client = "ca-pub-8389248272190393";
/* JshortBanner */
google_ad_slot = "4619227067";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><script type="text/javascript"><!--
google_ad_client = "ca-pub-8389248272190393";
/* JshortBanner */
google_ad_slot = "4619227067";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
    <script src="js/jquery-1.8.3.min.js"></script>
    <script src="js/jquery-ui-1.10.3.custom.min.js"></script>
    <script src="js/jquery.ui.touch-punch.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/bootstrap-select.js"></script>
    <script src="js/bootstrap-switch.js"></script>
    <script src="js/flatui-checkbox.js"></script>
    <script src="js/flatui-radio.js"></script>
    <script src="js/jquery.tagsinput.js"></script>
    <script src="js/jquery.placeholder.js"></script>
    <script src="js/jquery.stacktable.js"></script>
    <script src="http://vjs.zencdn.net/c/video.js"></script>
    <script src="js/application.js"></script>
  </body>
</html>

I tried doing recapcha in it. It failed. is there any chance anyone could help me integrate it?

Edited by JamieLyons
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.