Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Cpanel Email per username -Simple extension Details »»
Cpanel Email per username -Simple extension
Version: 1.00, by lebanon lebanon is offline
Developer Last Online: Jan 2014 Show Printable Version Email this Page

Version: 3.5.0 Rating:
Released: 03-05-2006 Last Update: 03-07-2006 Installs: 30
DB Changes Uses Plugins Template Edits
Additional Files Is in Beta Stage  
No support by the author.

This cpanel email extension, allows you to add email@urdomain per username.
The script will use mysql field value to determine wether the user has activated an email or not.
If not active will allow him to set email pass and activate.
If active will allow to directly login to webmail.
demo
http://www.tchatting.com/forum/email.php
Requires login ( "demo demo" pass 123456 ) but you will not be able to create a new email using it anyway thats why i added screenshots here.

Requirements are ofcourse a Cpanel username + no limits on email creation.

The script current features are :
Page only for registered ( No groups set but can be configured via source code )
Replaces Spaces from usernames to . (dot ) since emails cannot contain spaces.
REVISED : also characters such as # @ ~
If you prefer character _ instead of a . for spaces replacements it can be changed on line 92.

The script contains working functions , but not fancy stuff .
You can edit the template to add a faq section or something below logins.

Also it can be extended to allow user to delete his email account or change his email password from the email page but i didnt think its a good idea so i left them out (though can be added )

Finaly , if you have ideas to further extend those functions let me know, id be glad to share if i had more extra time .
Last note : Add a link wherever u want it to appear .


March 8th: Updated the the files, moved the config into includes and added htaccess contents as per Frugil post.
Added intrusctions on how to specify groups.
INSTALLATION
import the xml product .
Upload the rest of the files into your forum root
Link to the file !

Download Now

File Type: (21.4 KB, 0 views)
File Type: (21.4 KB, 0 views)
File Type: (21.4 KB, 0 views)
File Type: (21.4 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #72  
Old 05-29-2007, 12:41 PM
MissKalunji's Avatar
MissKalunji MissKalunji is offline
 
Join Date: Aug 2003
Location: Canada
Posts: 2,845
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Rukas View Post
Is there a 3.6 version?
it works on my 3.6 but there is still the same bugs
Reply With Quote
  #73  
Old 08-06-2007, 03:35 AM
LCN2007 LCN2007 is offline
 
Join Date: Jul 2007
Posts: 323
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by rizwan65 View Post
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
Reply With Quote
  #74  
Old 08-12-2007, 09:32 PM
alfaowner alfaowner is offline
 
Join Date: Jul 2003
Location: London
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MissKalunji View Post
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') . '");'); 



?>
Reply With Quote
  #75  
Old 08-14-2007, 01:10 PM
MissKalunji's Avatar
MissKalunji MissKalunji is offline
 
Join Date: Aug 2003
Location: Canada
Posts: 2,845
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you!!
Reply With Quote
  #76  
Old 08-14-2007, 10:24 PM
alfaowner alfaowner is offline
 
Join Date: Jul 2003
Location: London
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MissKalunji View Post
thank you!!
No probs, I guess it all works fine for you?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:07 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.04183 seconds
  • Memory Usage 2,340KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (4)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete