vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Cpanel Email per username -Simple extension (https://vborg.vbsupport.ru/showthread.php?t=109598)

MissKalunji 05-29-2007 12:41 PM

Quote:

Originally Posted by Rukas (Post 1256846)
Is there a 3.6 version?

it works on my 3.6 but there is still the same bugs

LCN2007 08-06-2007 03:35 AM

Quote:

Originally Posted by rizwan65 (Post 932469)
Well lebanon
I have checked my phpinfo
allow_url_fopen is on

and My password is also correct
I have rechecked it

How can you check if your fopen is on? im getting the same error
please help:confused:

alfaowner 08-12-2007 09:32 PM

Quote:

Originally Posted by MissKalunji (Post 978640)
Working perfectly only thing is user with a space doesnt create and doesnt even work


example one of my users killa k says it was created but when i go in cpanel it doesnts how and even when they try to login it says fail

(This was tested on 3.6.4 but will work on 3.5.x)
BACK UP your file www/forum/email.php then replace ALL the code in email.php with the following. It will then work for you :)

username of "the geezer" becomes the-geezer@emailaddress.co.uk
username of "the ultimate geezer" becomes the-ultimate-geezer@emailaddress.co.uk

AO

PHP Code:

<?php 







// ######################## SET PHP ENVIRONMENT ########################### 



error_reporting(E_ALL & ~E_NOTICE); 







// ##################### DEFINE IMPORTANT CONSTANTS ####################### 



// change the line below to the actual filename without ".php" extention. 



// the reason for using actual filename without extention as a value of this constant is to ensure uniqueness of the value throughout every PHP file of any given vBulletin installation. 







define('THIS_SCRIPT''email');  







// #################### PRE-CACHE TEMPLATES AND DATA ###################### 



// get special phrase groups 



$phrasegroups = array(); 







// get special data templates from the datastore 



$specialtemplates = array(); 







// pre-cache templates used by all actions 



$globaltemplates = array( 



        
// change the lines below to the list of actual templates used in the script 



        
'cpemail'



); 







// pre-cache templates used by specific actions 



$actiontemplates = array(); 







// ########################## REQUIRE BACK-END ############################ 



require_once('./global.php'); 

require_once(
DIR '/includes/functions_user.php');

include (
'./includes/cp_email_config.php');

if (!
is_member_of($vbulletin->userinfo5) AND !is_member_of($vbulletin->userinfo6) AND !is_member_of($vbulletin->userinfo31) AND !is_member_of($vbulletin->userinfo27) AND !is_member_of($vbulletin->userinfo7))



        
print_no_permission(); 

}  



// #################### HARD CODE JAVASCRIPT PATHS ######################## 



$headinclude str_replace('clientscript'$vbulletin->options['bburl'] . '/clientscript'$headinclude); 







// ######################################################################## 



// ######################### START MAIN SCRIPT ############################ 



// ######################################################################## 







$navbits = array();  



// change the line below to contain whatever you want to show in the navbar (title of your custom page) 



$navbits[$parent] = 'Cpanel Email Login & Registration Page'







$navbits construct_navbits($navbits); 



eval(
'$navbar = "' fetch_template('navbar') . '";'); 

$activate $_GET['activate'];

$cpun = ("" $vbulletin->userinfo['username'] . "");

$cpun1 str_replace"#""-"$cpun );

$cpun1 str_replace"~""-"$cpun ); 

$cpun1 str_replace"@""-"$cpun );

$cpun1 str_replace" ""-"$cpun );

$password =$_POST['password'];

$email $cpun;

ob_start(); 

if(
is_null($activate))

{

$cpquery $db->query_read("SELECT * FROM " TABLE_PREFIX "user AS user WHERE username='$cpun' ") or die(mysql_error()); 

    while (
$cpquery3 $db->fetch_array($cpquery))

    
$cpquery2 $cpquery3['cpmail'];

if (
$cpquery2 == 1) {     

    echo (
"You have 1 <b>inactive</b> email:: <b> $cpun1@$xxdomain </b><br>"); 

    echo (
"To activate your email enter a password below and click Activate<br>");

    echo (
"<form action=email.php?activate=1 method=post><input type=hidden name=email value=$cpun1 >");

    echo (
"<input type=hidden name=activate value=1 >");

    echo (
"<input type=hidden name=domain value=$xxdomain >");

    echo (
"<input type=text name=password value= >");

    echo (
"<input type=hidden name=quota value=$xxquota >");

    echo (
"    <input type=submit value=Activate name=submit class=button></form>");

} else { 

//echo $cpquery2;

    
echo ("You have an active email:: <b> $cpun1@$xxdomain </b>"); 

//CHANGED BY AO
    //echo ("<form action=cp_email_login.php method=post><input type=hidden name=user value=$cpun >");
    
echo ("<form action=cp_email_login.php method=post><input type=hidden name=user value=$cpun1 >");

        echo (
"<br><br>Enter Your Password To Continue:<br><input type=password name=pass><br><input type=submit name=login value=Login></form>");



}

else

{

//// start of email creation block



$url "http$ssl://$xxcpuser:$xxcppass@$xxdomain:$port/frontend/$xxcptheme/mail/doaddpop.html?email=$cpun1&domain=$xxdomain&password=$password&quota=$xxquota";



ini_set('user_agent','MSIE 4\.0b2;'); 



        
$filepointer fopen($url,"r");



  if(
$filepointer){



  while(!
feof($filepointer)){



              
$buffer fgets($filepointer4096);



                
$file .= $buffer;



            }



            
fclose($filepointer);



         } else {



              die(
" Sorry, Could not create a connection to our Mail Server, your email was not created, please hit the back button and try again: Contact the admin at $xxadmins_email if you encounter further problems");    

}



$message="Email Signup at $xxdomain \n account:$cpun1@$xxdomain \n username:$xxname quota:$xxquota login:$password\n\n If the user forgets their password you can change it in CPanel Email Maintanence \n\nRegards,";

//writing the success into database to prevent duplicate creations errors

$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "user SET cpmail = 2 WHERE username='$cpun' LIMIT 1");

//db updated 

     
if (preg_match("/exists/i"$file)) {

$status="failed";



echo (
"<center><br/><strong>Sorry <br> $cpun1@$xxdomain </strong><br/><br/>");

echo (
"has already been registered/activated. Please contact the administration.</center>");

echo (
"<br><br>");

} else {



$status="new account created";



echo 
"<br/><strong>Thank you $cpun ,</strong><br/>Your email address $cpun@$xxdomain with password $password has been created with $xxquota MB Storage! Thank you for signing up for <br\>$xxdomain email.<br/> You may go back into your email login page now at <a href='http://www.$forumurl/email.php'>http://www.$forumurl/email.php<br/><br/>";



}

//////end of the email creation block

}



$cpemail ob_get_contents(); 



ob_end_clean();







// change the line below to contain the name of the actual main output template used in your script 



eval('print_output("' fetch_template('cpemail') . '");'); 



?>


MissKalunji 08-14-2007 01:10 PM

thank you!!

alfaowner 08-14-2007 10:24 PM

Quote:

Originally Posted by MissKalunji (Post 1317337)
thank you!!

No probs, I guess it all works fine for you?


All times are GMT. The time now is 01:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01111 seconds
  • Memory Usage 1,786KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete