[]Astaran said: Maybe a bit offtopic, but where can i find some technical details about Hivemail( especially the backend)? Does it parse all incoming mail from a catch all account and inserts the data into a MySQL table? [/] Yes that is what it does Astaran. A cron script or a scheduled task in windows is responsible for this. The data is stored either in the database (the whole message) or in a file and the database (some data like the headers etc.)
1. ubbt.inc.php Function send_header. You need to include in the authenticate function the hm_emails field, otherwise it will always return zero. Hence you need to find this:
// ------------------------------------------------------------------- // If we don't have a status then they we need to try and authenticate if (!isset($user['U_Status'])) { $userob = new user; $user = $userob -> authenticate(); }
and replace it with this:
// ------------------------------------------------------------------- // If we don't have a status then they we need to try and authenticate if (!isset($user['U_Status'])) { $userob = new user; $user = $userob -> authenticate("hm_emails"); }
if (!isset($user['hm_emails'])) { $userob = new user; $user = $userob -> authenticate("hm_emails"); }
2. ubbthreads_plugin.php Function update_newmail
Change the function to :
function update_newmail() { global $dbh, $config;
$userob = new user; $user = $userob -> authenticate("hm_userid");
if ($hiveid != "0") { $query = "SELECT userid FROM {$options['database']}.hive_message WHERE userid = $hiveid AND status = 0"; $sth = $dbh -> do_query($query); $count=mysql_num_rows($sth); if ($count > 0) { $newemail = $count; } else { $newemail = 0; } $dbh -> do_query("UPDATE {$config['dbname']}.{$config['tbprefix']}Users SET hm_emails = '$newemail' WHERE hm_userid = $hiveid"); } }
}
This will use the .threads authenticate to see if the user is logged in and with one query retrieve the hm_userid as well. Also please note that the UPDATE query needs the {$config['dbname']) and not the 'dbserver', otherwise it points to the localhost (or wherever your DB is stored) instead of the database name.
It is working great for me!! Great job!
(now all I have to do is create some templates to match those of the .threads )
The way I chose was to have hm_email by default in the userob routine so it is part of the default just like new PM, maybe I missed that part will documenting the hack but It should work like this.
OK, checking the code I did forget something gimme a minute to tell you what it is supposed to be.
Do you believe in love at first sight, or should I walk by again?
// ----------------------------------------------------------------- <br /> // We are automatically adding StyleSheet, Status, Privates and <br /> // FrontPage and Number to each SQL call because this information is needed by <br /> // every script that makes a call to authenticate <br /> if ($Query != "*") { <br /> if ($Query) { $Query .=","; } <br /> $Query .= "U_Username,U_Password,U_SessionId, U_StyleSheet, U_Status, U_Privates, U_FrontPage, U_Number, U_Banned, hm_emails"; <br /> } <br />
since hm_emails is used on all pages we need it here, sorry for the bug
Do you believe in love at first sight, or should I walk by again?
[]Astaran said: Maybe a bit offtopic, but where can i find some technical details about Hivemail(especially the backend)? Does it parse all incoming mail from a catch all account and inserts the data into a MySQL table? [/]
It's choosable ... saving in MySQL or flatfile ...
also just for your info your update email function cannot work because we need to know if we have new emails BEFORE we identify otherwise the flashing image will use the old data. The goal is to update the data before we actually call for it
Do you believe in love at first sight, or should I walk by again?
well I tried the hivemail CP and apparently the only thing tou can edit is the user_data field. the other one is used I think to know which ones have been changed but I am not sure.
Do you believe in love at first sight, or should I walk by again?
well it works great when I do it but I need you guys to tell me when I forgot to put all the code in the files now if I did everything were would the fun be?
Do you believe in love at first sight, or should I walk by again?
Hi. Can I use the PIPE gateway for Hivemail instead of the POP gateway with this integration? Also, would you recommend merging the two databases into one?
Sorry but just one more question. I am going to give this a whirl tomorrow, but I need absolute clarification on which version of Hivemail to use. In the instructions it says version "1.21". I've never heard of that one. Charles said 1.2SP1 causes problems because the tables have different names. Because he is the co-author of this mod, I'm assuming it's not that one. Later jluerken stated that it would be unstable w/ 1.2.1 (which is different than "1.21") because there is a long bug list w/ that version (which is currently a Release Candidate only). I'm running version 1.2 right now. Is that the one I need? I don't know what 1.21 is
Although not specifically related to the hack... does anyone have a concern of allowing the use of your domain name for the mail? I have concerns of malicious mailings and or SPAM that might get the domain name Blacklisted.
Hmmm.. I seem to have a slight problem though... When a user goes to change their profile (edit/changebasic.php) they do manage to change their date (clicking Submit) but the forum presents this message:
Fatal error: Cannot redeclare hivemail_check_name() (previously declared in c:\<path here>\mail\includes\ubbthreads_plugin.php:74) in c:\<path here>\mail\includes\ubbthreads_plugin.php on line 72
Obviously there is a redeclaration somewhere. I tried to replace the require calls with require_once but had little effect...
I am still not clear why people opt for require. It does produce a fatal error if it there is a problem which is the good side but why not use require_once. If the script has already been included then it will not reload.
This minor change has worked very well for me on a Windows host with Apache. If others can please check if this works (on Linix boxes with Apache etc.) we can update the instructions accordingly.
[]sportbikes said: Although not specifically related to the hack... does anyone have a concern of allowing the use of your domain name for the mail? I have concerns of malicious mailings and or SPAM that might get the domain name Blacklisted. [/]
Real spammers would'nt use hivemail (or an account anyhwere), cause the admin could restrict the maximum recipients per message and additionally define a time limit between sending two or more mails ... for a better understanding i'll attach a screenshot of the admin area (definition of usergroups) ... click here for a bigger view
[]Stefan said: Real spammers would'nt use hivemail (or an account anyhwere), cause the admin could restrict the maximum recipients per message and additionally define a time limit between sending two or more mails ... for a better understanding i'll attach a screenshot of the admin area (definition of usergroups) ... click here for a bigger view [/]
Thanks! I was unaware of the admin functions.
I was not thinking of real spammers, but just a way for someone who may wish to purposely bring harm to the site, whether it is a banned member coming back under a dynamic IP or the site next door who doesn't like that you are suceeding
I'm almost done w/ the integration, but I ran into this problem in the Hivemail file changes, and it was right at the end: login-Template: ---------------
Replace all "vb_" parts with "ubbt_"
What is the file this is in? Where do I go? I'm sure it's a simple "Replace" command from the edit menu, but I don't know where to go to do this part.
Secondly, can you write here the SQL command(s) I would need to integrate and existing forum user w/ their existing email account? Thanks!
---EDIT--- BTW, where do I define the variable [UBBT_PATH] that is on the line that I add to Hivemail global.php? I got an error (many errors, but this was one of them) because of this. I replaced the variable and put the actual path to the config.inc.php file, but thzt's only because I don't recall seeing where to declare that variable.
don Julio you can use the following command to update the login Template. There is no file it is in the HIVE database.
Code
<br />UPDATE hive_template SET user_data = REPLACE(user_data,"vb_","ubbt_"), parsed_data = REPLACE(parsed_data,"vb_","ubbt_") WHERE title = 'login'<br />
for updating the user profile I can't think of anything because you would need to know what email adress is associated with which profile. So unless they use the hivemail email in their ubb.threads profile there is no waz no actually know.
Do you believe in love at first sight, or should I walk by again?
I think I did everything correctly and I'm getting this error in my forums: [] SQL ERROR: Database error only visible to forum administrators
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/laondal/public_html/foros/mysql.inc.php on line 131 SQL ERROR: Database error only visible to forum administrators
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/laondal/public_html/foros/mysql.inc.php on line 131 [/]
The email seems to be working all right. This is the second time I've done the integration and I solved the email problem (which was that I didn't go to the admin area of hivemail and turn on the integration). But in my forums I'm getting that error. Plus the cookies don't seem to be working because I was logged out. I tried logging back in to see what the database error was and it said that the username and password couldn't be found. I tried again w/ a different user name and the same thing happened However when I replace the forums with the old ones (I'm talking about the forums directory), everything works fine, minius the Hivemail integration. Is there a problem with my database?
--EDIT--
I get this error when trying to read mail: [] MySQL error: Unknown column 'hm_emails' in 'field list' MySQL error number: 1054 Script: /correo/read.email.php?messageid=1243 Date: August 15, 2003, 12:15 pm
Invalid query: UPDATE laondal_boards.w3t_Users SET hm_emails = hm_emails - 1 WHERE hm_userid = 3 [/] Good damn thing I have both databases backed up from before integration. Any idea on what the problem is?
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.