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)

steadicamop 03-08-2006 11:14 AM

Sorry to seem stupid on this, but when I use my login details for my control panel, and then try to access my email through the forum I get this error:

Quote:

Warning: fopen(http://...@steadiforum.com:2082/fron...xxP&quota=10): failed to open stream: Connection refused in /email.php on line 125
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 mail if you encounter further problems
I'm pretty stuck on this one, not sure if it possible with my current hosting.

Thanks,

Jason

lebanon 03-08-2006 11:42 AM

did you edit cp_email_config correctly ? the file that should be uploaded to the includes folder.
There you should add your cpanel and login details as specified .If everything is surely okey , just check if your phpinfo setting allows fopen as well.

melefire 03-12-2006 11:00 PM

can u set it so only certain usergroups get email adresses

lebanon 03-13-2006 08:02 AM

melefire , instructions are within the readme.txt as well as in previous posts, u have to do this manually by changing a line in email.php

melefire 03-13-2006 10:02 AM

thx i will use it now

rizwan65 03-21-2006 09:06 AM

Labanon
Should it work on vb 3.5.3
I tried to install on VB 3.5.3
and getting the error

Quote:

Warning: fopen(http://...@mydomain.com:2082/frontend/x/mail/doaddpop.html?email=abc&domain=mydomain.com&passwo rd=123456"a=5): failed to open stream: Connection refused in /email.php on line 128
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 admin@mydomain.com if you encounter further problems

Any suggestions

lebanon 03-21-2006 01:07 PM

rizwan65, this actually means the script is working, the couldnt open a connection could come up for two reasons:
cpanel user and password supplied in the config are not set correctly
or you are not allowed to use fopen on your server.

fatalsex 03-22-2006 02:20 PM

AWESOME HACK!
But tell me please...
1-If i dont have CPANEL ? How can i use it?
2-If i have POP3 mail server seperately from my Vbulletin server ?
how can i work with this ?
Thank you for this GREAT hack

rizwan65 03-23-2006 03:45 AM

Quote:

Originally Posted by lebanon
rizwan65, this actually means the script is working, the couldnt open a connection could come up for two reasons:
cpanel user and password supplied in the config are not set correctly
or you are not allowed to use fopen on your server.

Well lebanon
I have checked my phpinfo
allow_url_fopen is on

and My password is also correct
I have rechecked it

Mr Chad 04-28-2006 11:45 PM

is it possible to do the same thing but instead of actual emails, just creates email forwards

donatas 04-29-2006 08:56 AM

yeah, forwarding would be nice!

lebanon 04-29-2006 09:08 AM

actually forwarding is much easier to create, but then i will have to re-post it in another script, because it will require deleting the code where to alter the database and to remove login box and so on, and only keep a value wether he has the forwarder created or not.
but typically a change would be in the url to be opened thats all ( the rest would be actually design wise because login boxes are then useless)
http$ssl://$xxcpuser:$xxcppass@$xxdomain:$port/frontend/$xxcptheme/mail/doaddpop.html?email=$cpun1&domain=$xxdomain&passwo rd=$password&quota=$xxquota";
shoud be like
http$ssl://$xxcpuser:$xxcppass@$xxdomain:$port/frontend/$xxcptheme/mail/doaddfwd.html?email=$cpun1&forward=$email2";

know what, ill post this later as a whole code , maybe later on hopefully

donatas 04-29-2006 09:45 AM

just like idea:
in CP user has button/checkbox "Enable email forwarding" and input "forward to email"
so if user enables forwarding, then in cpanel will be added entry with all these data (new email and where it forwarded), also wolud be cool to add 2 array, with letters replacing (by default " " -> "." (or maybe "_") also pips could add cyrilic->translit replacement (for ex)

MissKalunji 05-16-2006 12:45 AM

if (!is_member_of($vbulletin->userinfo, 19) AND !is_member_of($vbulletin->userinfo, 22)) AND !is_member_of($vbulletin->userinfo, 6))

its giving me an error :-/

MissKalunji 05-16-2006 04:01 AM

and One of my users has a space in his name so its not working is there a way for it to add the . itself and when you login fixes all that?

Thanks

TTG 05-16-2006 03:07 PM

How can you delete an email addy .. I've removed it from the cpanel but it still shows in the forum and asks for a login to an email addy that no longer exists !?

MissKalunji 05-17-2006 12:59 PM

Quote:

Originally Posted by MissKalunji
and One of my users has a space in his name so its not working is there a way for it to add the . itself and when you login fixes all that?

Thanks


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

MissKalunji 05-20-2006 02:00 PM

bump

lebanon 05-21-2006 12:38 PM

MissKalunji, by default as i described it will replace characters that cannot be accepted in email forms to a . (dot)
Which means their email by default is kala.k not kala k
If you want to change that change the lines in email.php
$cpun1 = str_replace( " ", ".", $cpun );
Replace the "." with your desired character , which can be mostly a dot or _ for example.

MissKalunji 05-21-2006 01:50 PM

Thats what im saying...it doesnt CREATE IT AT ALL!

robgeo 05-22-2006 10:59 AM

Suppose you don't use CPanel? Is there a way to make this work with VDeck as well?

MissKalunji 06-14-2006 03:05 PM

Quote:

Originally Posted by MissKalunji
Thats what im saying...it doesnt CREATE IT AT ALL!

bump!

bogie 06-30-2006 07:04 AM

I just installed this on my vbulletin and it works fine with members that have no spaces or special characters in their username. The problem is that when a user with a space in their username tries to create an account, it attempts to create the username with a space instead of the . (dot) as it should. No account is created but when they go to the /email.php url it shows they have an active email. I checked CPanel and no account was created.

Anyone know how I can fix this?

MissKalunji 06-30-2006 12:42 PM

i've been trying to get an answer:(

alfaowner 01-24-2007 01:17 PM

Quote:

Originally Posted by MissKalunji (Post 1019113)
i've been trying to get an answer:(

Yup, I can confirm that the Space in a users name is a problem, it does not use the replace feature you mention, I will try and code this later on tonight if I get a chance as I am not sure I will use this? Or has anyone got this working yet?

AO

MissKalunji 01-25-2007 05:27 PM

oh plz! i've been wanting this to work forever

alfaowner 01-25-2007 05:59 PM

Had a quick look, I guess cpanel have changed something in the way they process new email accounts, i will get to this but right now I am snowed under!

I will get there.

AO

blogtorank 01-28-2007 03:19 AM

Quote:

Originally Posted by alfaowner (Post 1167157)
Had a quick look, I guess cpanel have changed something in the way they process new email accounts, i will get to this but right now I am snowed under!

I will get there.

AO

Hope all is well mate, and the snow melts! They went from mbox to mdir or something of that nature...

MissKalunji 01-28-2007 10:26 PM

Quote:

Originally Posted by alfaowner (Post 1167157)
Had a quick look, I guess cpanel have changed something in the way they process new email accounts, i will get to this but right now I am snowed under!

I will get there.

AO


thanks in advance!

Rukas 05-29-2007 12:14 PM

Is there a 3.6 version?

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:28 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.01455 seconds
  • Memory Usage 1,872KB
  • 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
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (35)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