Jump to content

Recommended Posts

hi guys,

 

i have recently installed Social Engine.

 

i got a small Error when trying to re-send email verification: Fatal error: Call to undefined method stdClass::user_displayname() in /var/www/vhosts/httpdocs/signup_verify.php on line 43

 

Do someone has any idea about it ?

 

file is attached!

 

 

Thanks

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/129800-resend-email-verification/
Share on other sites

Where are you creating the $thisuser object?  Its not in your code.  ($thisuser = new classname();)

 

The error is saying that the method (function in a class) doesn't exist in your class.

 

More people will probably read this if you posted it in your post (using code tags of course) instead of a download link...

In the same file.

Here is the code.

<?php
$page = "signup_verify";
include "header.php";

if(isset($_POST['task'])) { $task = $_POST['task']; } elseif(isset($_GET['task'])) { $task = $_GET['task']; } else { $task = "main"; }
if(isset($_POST['verify'])) { $verify = $_POST['verify']; } elseif(isset($_GET['verify'])) { $verify = $_GET['verify']; } else { $verify = ""; }
if(isset($_POST['u'])) { $u = $_POST['u']; } elseif(isset($_GET['u'])) { $u = $_GET['u']; } else { $u = 0; }

// SET ERROR VARS
$is_error = 0;
$result = 0;

// SET RESEND FOR APPROPRIATE TASK
if($task == "resend") { $resend = 1; } else { $resend = 0; }

// IF VERIFICATIONS ARE TURNED OFF, RETURN TO HOME
if($setting[setting_signup_verify] == 0) { header("Location: home.php"); exit(); }


// RESEND EMAIL
if($task == "resend_do") {
  $resend = 1;
  $resend_email = $_POST['resend_email'];
  $user_query = $database->database_query("SELECT user_id, user_email, user_code, user_username, user_fname, user_lname, user_verified, user_newemail FROM se_users WHERE user_newemail='$resend_email'");

  // VERIFY USER EXISTS
  if($database->database_num_rows($user_query) != 1) {
    $is_error = 1038;
    $user_info['user_code'] = "";
    $user_info['user_email'] = "";
    $user_info['user_newemail'] = "";
    $user_info['user_verified'] = "";
  } else {
    $user_info = $database->database_fetch_assoc($user_query);
    $thisuser->user_exists = 1;
    $thisuser->user_info[user_id] = $user_info[user_id];
    $thisuser->user_info[user_username] = $user_info[user_username];
    $thisuser->user_info[user_fname] = $user_info[user_fname];
    $thisuser->user_info[user_lname] = $user_info[user_lname];
    $thisuser->user_info[user_email] = $user_info[user_email];
    $thisuser->user_info[user_newemail] = $user_info[user_newemail];
    $thisuser->user_info[user_code] = $user_info[user_code];
    $thisuser->user_displayname();
  }

  // VERIFY USER IS NOT ALREADY VERIFIED  
  if($user_info[user_verified] == 1 && $user_info[user_email] == $user_info[user_newemail]) { $is_error = 1044; }

  // NO ERROR, RESEND EMAIL
  if($is_error == 0) {
    $verify_code = md5($thisuser->user_info[user_code]);
    $time = time();
    $verify_link = $url->url_base."signup_verify.php?u=".$thisuser->user_info[user_id]."&verify=$verify_code&d=$time";
    send_systememail('verification', $thisuser->user_info[user_newemail], Array($thisuser->user_displayname, $thisuser->user_info[user_newemail], "<a href=\"$verify_link\">$verify_link</a>")); 
    $result = 1042; 
  }


// CHECK VERIFICATION
} elseif($resend != 1) {

  // VALIDATE USER ID
  $new_user = new se_user(Array($u));
  if($new_user->user_exists == 0) { $is_error = 1039; }

  // ENSURE NEW EMAIL NOT ALREADY TAKEN
  if($database->database_num_rows($database->database_query("SELECT user_id FROM se_users WHERE user_email='".$new_user->user_info[user_newemail]."' AND user_id<>'".$new_user->user_info[user_id]."'")) != 0) {
    $is_error = 1037;
  }

  // CHECK VERIFICATION URL
  if(md5($new_user->user_info[user_code]) !== $verify) { $is_error = 1039; }

  // VERIFY EMAIL ADDRESS IF NO ERROR
  if($is_error == 0) {  
  
    // SET SUBNETWORK
    $subnet = $new_user->user_subnet_select($new_user->user_info[user_newemail], $new_user->user_info[user_profilecat_id], $new_user->profile_info); 
    if($subnet[0] != $new_user->user_info[user_subnet_id]) {
      $new_subnet_id = $subnet[0];
      $result = 1041;
    } else {
      $new_subnet_id = $new_user->user_info[user_subnet_id];
      $result = 1028;
    }

    $database->database_query("UPDATE se_users SET user_subnet_id='$new_subnet_id', user_verified='1', user_email='".$new_user->user_info[user_newemail]."' WHERE user_id='".$new_user->user_info[user_id]."'");
   
    // SEND WELCOME EMAIL IF USER JUST SIGNED UP
    if($new_user->user_info[user_verified] == 0) {
      send_systememail('welcome', $new_user->user_info[user_newemail], Array($new_user->user_displayname, $new_user->user_info[user_newemail], '', "<a href=\"".$url->url_base."login.php\">".$url->url_base."login.php</a>"));
    }



  }
}




// ASSIGN VARIABLES AND INCLUDE FOOTER
$smarty->assign('is_error', $is_error);
$smarty->assign('resend', $resend);
$smarty->assign('result', $result);
$smarty->assign('old_subnet_name', $subnet[2]);
$smarty->assign('new_subnet_name', $subnet[1]);
include "footer.php";
?>

 

Thanks

Where are you creating the $thisuser object?  Its not in your code.  ($thisuser = new classname(); )

 

The error is saying that the method (function in a class) doesn't exist in your class.

Nobody will be able to help without these answered.  Whats in your 'header.php' file?

My header.php

 

<?php

// SET ERROR REPORTING
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
ini_set('display_errors', TRUE);

// CHECK FOR PAGE VARIABLE
if(!isset($page)) { $page = ""; }

// DEFINE SE PAGE CONSTANT
define('SE_PAGE', true);

// SET INCLUDE PATH TO ROOT OF SE
set_include_path(get_include_path() . PATH_SEPARATOR . realpath("./"));

// INITIATE SMARTY
$folder = "base";
include "include/smarty/smarty_config.php";

// INCLUDE DATABASE INFORMATION
include "include/database_config.php";

// INCLUDE CLASS/FUNCTION FILES
include "include/class_admin.php";
include "include/class_database.php";
include "include/class_datetime.php";
include "include/class_comment.php";
include "include/class_field.php";
include "include/class_hook.php";
include "include/class_language.php";
include "include/class_notify.php";
include "include/class_upload.php";
include "include/class_user.php";
include "include/class_url.php";
include "include/class_misc.php";
include "include/class_ads.php";
include "include/class_actions.php";
include "include/functions_general.php";
include "include/functions_email.php";
include "include/functions_stats.php";

// INITIATE DATABASE CONNECTION
$database = new se_database($database_host, $database_username, $database_password, $database_name);

// SET DATABASE CONSTANTS
$database->database_query("SET @SE_PRIVACY_SELF = 1, @SE_PRIVACY_FRIEND = 2, @SE_PRIVACY_FRIEND2 = 4, @SE_PRIVACY_SUBNET = 8, @SE_PRIVACY_REGISTERED = 16, @SE_PRIVACY_ANONYMOUS = 32");

// SET LANGUAGE CHARSET
$database->database_set_charset(SE_Language::info('charset'));

// GET SETTINGS
$setting = $database->database_fetch_assoc($database->database_query("SELECT * FROM se_settings LIMIT 1"));

// CREATE URL CLASS
$url = new se_url();

// CREATE DATETIME CLASS
$datetime = new se_datetime();

// CREATE MISC CLASS
$misc = new se_misc();

// ENSURE NO SQL INJECTIONS THROUGH POST OR GET ARRAYS
$_POST = security($_POST);
$_GET = security($_GET);
$_COOKIE = security($_COOKIE);

// CHECK FOR PAGE OWNER
if(isset($_POST['user'])) { $user_username = $_POST['user']; } elseif(isset($_GET['user'])) { $user_username = $_GET['user']; } else { $user_username = ""; }
if(isset($_POST['user_id'])) { $user_id = $_POST['user_id']; } elseif(isset($_GET['user_id'])) { $user_id = $_GET['user_id']; } else { $user_id = ""; }
$owner = new se_user(Array($user_id, $user_username));

// CREATE USER OBJECT AND ATTEMPT TO LOG USER IN
$user = new se_user();
$user->user_checkCookies();

// USER IS LOGGED IN
if($user->user_exists != 0) { 

  // SET TIMEZONE IF USER IS LOGGED IN
  $global_timezone = $user->user_info[user_timezone];

// USER IS NOT LOGGED IN
} else { 

  // SEND USER TO LOGIN IF TRYING TO ACCESS USER CONTROL PANEL
  if(substr($page, 0, 5) == "user_") { header("Location: login.php?return_url=".$url->url_current()); exit(); }

  // SET TIMEZONE IF USER IS LOGGED OUT
  $global_timezone = $setting[setting_timezone]; 

  // SET VISITOR LAST ACTIVE TIME
  $database->database_query("INSERT INTO se_visitors (visitor_ip, visitor_lastactive) VALUES ('".$_SERVER['REMOTE_ADDR']."', '".time()."') ON DUPLICATE KEY UPDATE visitor_lastactive = '".time()."'");
}


// SET UP LANGUAGE VARIABLES
if(isset($_GET['lang_id']) && $setting[setting_lang_allow] == 1 && $user->user_exists != 0) {
  $user->user_info[user_language_id] = (int)$_GET['lang_id'];
  setcookie('se_language_anonymous', $user->user_info[user_language_id], time()+99999999, "/");
  $database->database_query("UPDATE se_users SET user_language_id='".$user->user_info[user_language_id]."' WHERE user_id='".$user->user_info[user_id]."'");
} elseif(isset($_GET['lang_id']) && $setting[setting_lang_anonymous]) {
  setcookie('se_language_anonymous', (int)$_GET['lang_id'], time()+99999999, "/");
  $_COOKIE['se_language_anonymous'] = (int)$_GET['lang_id'];
}

SE_Language::select($user);
if(SE_Language::info('language_setlocale') != '') { $multi_language = 1; setlocale(LC_TIME, SE_Language::info('language_setlocale')); }
header("Content-Language: ".SE_Language::info('language_code'));


// UPDATE STATS TABLE
update_stats("views");

// CREATE ACTIONS CLASS
$actions = new se_actions();

// CREATE NOTIFICATION CLASS
$notify = new se_notify();

// CREATE ADS CLASS
$ads = new se_ads();

// CREATE GLOBAL CSS STYLES VAR (USED FOR CUSTOM USER-DEFINED PROFILE/PLUGIN STYLES)
$global_css = "";




// INCLUDE RELEVANT PLUGIN FILES
// AND SET PLUGIN HEADER TEMPLATES
$show_menu_user = FALSE;
$global_plugins = Array();
$plugins = $database->database_query("SELECT plugin_type, plugin_icon FROM se_plugins WHERE plugin_disabled=0 ORDER BY plugin_id DESC");
while($plugin_info = $database->database_fetch_assoc($plugins)) { 
  $plugin_vars = Array();
  if(file_exists("header_".$plugin_info[plugin_type].".php")) { include "header_".$plugin_info[plugin_type].".php"; } 
  $global_plugins[$plugin_info[plugin_type]] = $plugin_vars;
  if($plugin_vars[menu_user] != "") { $show_menu_user = TRUE; }
}
$global_plugins[plugin_controls] = Array('show_menu_user' => $show_menu_user);






// CHECK TO SEE IF SITE IS ONLINE OR NOT
if($setting[setting_online] == 0) {
  // CREATE ADMIN OBJECT AND ATTEMPT TO LOG ADMIN IN
  $admin = new se_admin();
  $admin->admin_checkCookies();
  // ADMIN NOT LOGGED IN, DISPLAY OFFLINE PAGE
  if($admin->admin_exists == 0) {
    $page = "offline";
    include "footer.php";
  }
}


// CALL HEADER HOOK
($hook = SE_Hook::exists('se_header')) ? SE_Hook::call($hook, array()) : NULL;


// CHECK IF LOGGED-IN USER IS ON OWNER'S BLOCKLIST
if($user->user_exists == 1) {
  if($owner->user_blocked($user->user_info[user_id])) {
    // ASSIGN VARIABLES AND DISPLAY ERROR PAGE
    $page = "error";
    $smarty->assign('error_header', 639);
    $smarty->assign('error_message', 640);
    $smarty->assign('error_submit', 641);
    include "footer.php";
  }
}


// CHECK TO SEE IF USER HAS BEEN BLOCKED BY IP
$banned_ips = explode(",", $setting[setting_banned_ips]);
if(in_array($_SERVER['REMOTE_ADDR'], $banned_ips)) {
  // ASSIGN VARIABLES AND DISPLAY ERROR PAGE
  $page = "error";
  $smarty->assign('error_header', 639);
  $smarty->assign('error_message', 807);
  $smarty->assign('error_submit', 641);
  include "footer.php";
}

?>

 

Thanks

Already done! my ticket is still opened. And i need to solve it in best time because it's for a costumer.

 

Here ia class_user file + all others (without install one)

ps: class_user file exceed le limit of carsacters

 

File: http://tinyurl.com/5qbu5w

 

Thanks

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.