Jump to content
  • 0

need help how to fix reset password?


Famous

Question


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

Error: Flux_Error

Message: MySQL error (SQLSTATE: 42S22, ERROR: 1054): Unknown column 'level' in 'field list'

File: /home5/zhenron2/public_html/lib/Flux/Connection/Statement.php:27
File 	Line 	Function/Method
/home5/zhenron2/public_html/modules/account/resetpass.php 	34 	Flux_Connection_Statement::execute()
/home5/zhenron2/public_html/lib/Flux/Template.php 	337 	include()
/home5/zhenron2/public_html/lib/Flux/Dispatcher.php 	168 	Flux_Template::render()
/home5/zhenron2/public_html/index.php 	177 	Flux_Dispatcher::dispatch()

 

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  815
  • Reputation:   86
  • Joined:  10/26/12
  • Last Seen:  

this is your error

 

 

Message: MySQL error (SQLSTATE: 42S22, ERROR: 1054): Unknown column 'level' in 'field list'
 

 

 

change the level to groupd_id

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

where can I find group ID?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  815
  • Reputation:   86
  • Joined:  10/26/12
  • Last Seen:  

column

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

is that from cp_resetpass?

what should I put in ID group?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

also in forgot password i got the same error

<?php

if (!defined('FLUX_ROOT')) exit;



$title = Flux::message('ResetPassTitle');



$serverNames    = $this->getServerNames();

$resetPassTable = Flux::config('FluxTables.ResetPasswordTable');



if (count($_POST)) {

	$userid    = $params->get('userid');

	$email     = $params->get('email');

	$groupName = $params->get('login');

	

	if (!$userid) {

		$errorMessage = Flux::message('ResetPassEnterAccount');

	}

	elseif (!$email) {

		$errorMessage = Flux::message('ResetPassEnterEmail');

	}

	else {

		if (!$groupName || !($loginAthenaGroup=Flux::getServerGroupByName($groupName))) {

			$loginAthenaGroup = $session->loginAthenaGroup;

		}



		$sql  = "SELECT account_id, user_pass, level FROM {$loginAthenaGroup->loginDatabase}.login WHERE ";

		if ($loginAthenaGroup->loginServer->config->getNoCase()) {

			$sql .= 'LOWER(userid) = LOWER(?) ';

		}

		else {

			$sql .= 'BINARY userid = ? ';

		}

		$sql .= "AND email = ? AND state = 0 AND sex IN ('M', 'F') LIMIT 1";

		$sth  = $loginAthenaGroup->connection->getStatement($sql);

		$sth->execute(array($userid, $email));



		$row = $sth->fetch();

		if ($row) {

			if ($row->level >= Flux::config('NoResetPassLevel')) {

				$errorMessage = Flux::message('ResetPassDisallowed');

			}

			else {

				$code = md5(rand() + $row->account_id);

				$sql  = "INSERT INTO {$loginAthenaGroup->loginDatabase}.$resetPassTable ";

				$sql .= "(code, account_id, old_password, request_date, request_ip, reset_done) ";

				$sql .= "VALUES (?, ?, ?, NOW(), ?, 0)";

				$sth  = $loginAthenaGroup->connection->getStatement($sql);

				$res  = $sth->execute(array($code, $row->account_id, $row->user_pass, $_SERVER['REMOTE_ADDR']));

				

				if ($res) {

					require_once 'Flux/Mailer.php';

					$name = $loginAthenaGroup->serverName;

					$link = $this->url('account', 'resetpw', array('_host' => true, 'code' => $code, 'account' => $row->account_id, 'login' => $name));

					$mail = new Flux_Mailer();

					$sent = $mail->send($email, 'Reset Password', 'resetpass', array('AccountUsername' => $userid, 'ResetLink' => htmlspecialchars($link)));

				}

			}

		}



		if (empty($errorMessage)) {

			if (empty($sent)) {

				$errorMessage = Flux::message('ResetPassFailed');

			}

			else {

				$session->setMessageData(Flux::message('ResetPassEmailSent'));

				$this->redirect();

			}

		}

	}

}

?>
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

Problem solve!

Link to comment
Share on other sites

×
×
  • Create New...