Перейти к контенту
  • 0

возможно ли узнать пароль пользователя?


Вопрос

сразу хочу сказать, не в корыстных целях)

хотелось бы удалить себя из друзей одного пользователя, не меняя при этом его пароль)

Ссылка на комментарий
Поделиться на других сайтах

Рекомендуемые сообщения

  • 0

Вход под пользователям на форуме через АЦ

 

Открыть: ./sources/acp_loaders/acp_pages_content.php

 

Найти:

 

11 => array ( 'Инструменты IP'       , 'section=content&act=mtools'        ),

 

Добавить ниже:

 

13 => array ( 'Просмотр пользователя'          , 'section=content&act=mem&code=member_snoop' ),

 

Сохраняем.

 

Открыть: ./sources/action_admin/member.php

 

Найти:

 

case 'member_delete':
			$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':remove' );
			$this->member_delete();
			break;

Добавить ниже:

 

case 'member_snoop':
			$this->member_snoop();
			break;

 

Найти:

 

/*-------------------------------------------------------------------------*/
// Member Delete posts, PROCESS
/*-------------------------------------------------------------------------*/

 

Добавить выше:

 

	/*-------------------------------------------------------------------------*/
// Вход под пользователям на форуме через АЦ
/*-------------------------------------------------------------------------*/

function member_snoop()
{
	$this->ipsclass->admin->nav[] 		= array('', 'Просмотр пользователя');
	$this->ipsclass->admin->page_title  = "Просмотр пользователя";
	$this->ipsclass->admin->page_detail = "С этой функцией можно зайти на форум под логинам пользователя!.";

	//-----------------------------------------
	// Make sure we're a root admin, or else!
	//-----------------------------------------

	if ($this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'])
	{
		$this->ipsclass->admin->error("Sorry, this function is for the root admin group only");
	}

	//-----------------------------------------
	// Do log in?
	//-----------------------------------------

	if ($_POST['UserName'])
	{
		$member = array();

		# Check for input length
		if ($this->ipsclass->vars['ipbli_usertype'] == 'username')
		{
			if ($this->ipsclass->txt_mb_strlen($_POST['UserName']) > 32)
			{
				$this->ipsclass->admin->error("The username you entered was too long.");
			}

			$username = strtolower(str_replace('|', '|', $this->ipsclass->input['UserName']));
		}
		else
		{
			$username = strtolower(trim($this->ipsclass->input['UserName']));
		}

		# Check auth
		if ($this->ipsclass->vars['ipbli_usertype'] == 'username')
		{
			$member = $this->ipsclass->DB->build_and_exec_query(array('select'   => 'm.id, m.name, m.members_display_name, m.members_created_remote, m.email, m.mgroup, m.member_login_key, m.member_login_key_expire, m.ip_address, m.login_anonymous, m.joined, m.mgroup_others, m.org_perm_id',
																	  'from'     => array('members' => 'm'),
																	  'where'    => "m.members_l_username='".strtolower($username) ."'",
																	  'add_join' => array(
																			0 => array('select' => 'g.*',
																		 			   'from'   => array('groups' => 'g'),
																		  			   'where'  => 'g.g_id=m.mgroup',
																					   'type'   => 'inner'))));

			if (! $member['id'])
			{
				$this->ipsclass->admin->error("Sorry, we could not find a member using those log in details.");
			}

			$this->ipsclass->converge->converge_load_member($member['email']);

			if (! $this->ipsclass->converge->member['converge_id'])
			{
				$this->ipsclass->admin->error("Login failed!");
			}
		}
		else
		{
			$email = $username;
			$this->ipsclass->converge->converge_load_member($email);

			if ($this->ipsclass->converge->member['converge_id'])
			{
				$member = $this->ipsclass->DB->build_and_exec_query(array('select'   => 'm.id, m.name, m.members_display_name, m.members_created_remote, m.email, m.mgroup, m.member_login_key, m.member_login_key_expire, m.ip_address, m.login_anonymous, m.joined, m.mgroup_others, m.org_perm_id',
																	  'from'     => array('members' => 'm'),
																	  'where'    => "m.email='".strtolower($username)."'",
																	  'add_join' => array(
																			0 => array('select' => 'g.*',
																		 			   'from'   => array('groups' => 'g'),
																		  			   'where'  => 'g.g_id=m.mgroup',
																					   'type'   => 'inner'))));
			}
			else
			{
				$this->ipsclass->admin->error("Sorry, we could not find a member using those log in details.");
			}
		}

		# Is this a partial member?
		if ($member['members_created_remote'])
		{
			$pmember = $this->ipsclass->DB->build_and_exec_query(array('select' => '*', 'from' => 'members_partial', 'where' => 'partial_member_id='.$member['id']));
			if ($pmember['partial_member_id'])
			{
				$this->ipsclass->admin->error("Sorry, this member has not completed his/her sign in yet.");
			}
		}

		# Generate a new log in key
		$_time   = ($this->ipsclass->vars['login_key_expire']) ? (time() + (intval($this->ipsclass->vars['login_key_expire']) * 86400)) : 0;
		$_sticky = $_time ? 0 : 1;
		$_days   = $_time ? $this->ipsclass->vars['login_key_expire'] : 365;

		if ($this->ipsclass->vars['login_change_key'] || ! $member['member_login_key'] || ($this->ipsclass->vars['login_key_expire'] && (time() > $member['member_login_key_expire'])))
		{
			$member['member_login_key'] = $this->ipsclass->converge->generate_auto_log_in_key();
			$this->ipsclass->DB->do_update('members', array('member_login_key' => $member['member_login_key'], 'member_login_key_expire' => $_time), 'id='.$member['id']);
		}

		#Strong hold cookie?
		$this->ipsclass->stronghold_set_cookie($member['id'], $member['member_login_key'], 1);

		# Cookie me softly?
		if ($this->ipsclass->input['CookieDate'])
		{
			$this->ipsclass->my_setcookie("member_id", $member['id'], 1);
			$this->ipsclass->my_setcookie("pass_hash", $member['member_login_key'], $_sticky, $_days);
		}

		$this->ipsclass->my_setcookie("coppa", '0', 0);

		# Update profile if IP addr missing
		if ($member['ip_address'] == "" || $member['ip_address'] == '127.0.0.1')
		{
			$this->ipsclass->DB->simple_construct(array('update' => 'members',
														'set'    => "ip_address='{$this->ipsclass->ip_address}'",
														'where'  => 'id='.$member['id']
												)     );
			$this->ipsclass->DB->simple_exec();
		}

		# Create / Update session
		$poss_session_id = "";

		if ($cookie_id = $this->ipsclass->my_getcookie('session_id'))
		{
			$poss_session_id = $this->ipsclass->my_getcookie('session_id');
		}
		elseif ($this->ipsclass->input['s'])
		{
			$poss_session_id = $this->ipsclass->input['s'];
		}

		$poss_session_id = preg_replace("/([^a-zA-Z0-9])/", "", $poss_session_id);
		$privacy = $this->ipsclass->input['Privacy'] ? 1 : 0;

		if ($poss_session_id)
		{
			$session_id = $poss_session_id;

			$this->ipsclass->DB->simple_construct(array('delete' => 'sessions', 'where' => "ip_address='".$this->ipsclass->ip_address."' AND id <> '$session_id'"));
			$this->ipsclass->DB->simple_shutdown_exec();

			$this->ipsclass->DB->do_shutdown_update('sessions', array(
													'member_name'  => $member['members_display_name'],
													'member_id'    => $member['id'],
													'running_time' => time(),
													'member_group' => $member['mgroup'],
													'login_type'   => $privacy), "id='".$session_id."'"
													);
		}
		else
		{
			$session_id = md5(uniqid(microtime()));

			$this->ipsclass->DB->simple_construct(array('delete' => 'sessions', 'where' => "ip_address='".$this->ipsclass->ip_address."'"));
			$this->ipsclass->DB->simple_shutdown_exec();

			$this->ipsclass->DB->do_shutdown_insert('sessions', array(
													'id'           => $session_id,
													'member_name'  => $member['members_display_name'],
													'member_id'    => $member['id'],
													'running_time' => time(),
													'member_group' => $member['mgroup'],
													'ip_address'   => $this->ipsclass->ip_address,
													'browser'      => substr($this->ipsclass->clean_value($this->ipsclass->my_getenv('HTTP_USER_AGENT')), 0, 50),
													'login_type'   => $privacy)
													);
		}

		$this->ipsclass->member     = $member;
		$this->ipsclass->session_id = $session_id;

		# Set our privacy status
		$this->ipsclass->DB->simple_construct(array('update' => 'members',
													'set'    => "login_anonymous='".$privacy."&1'",
													'where'  => 'id='.$member['id']
											)     );
		$this->ipsclass->DB->simple_shutdown_exec();

		# Redirect them to the board index
		$this->ipsclass->my_setcookie("session_id", $this->ipsclass->session_id, -1);
		$this->logged_in = 1;

		if (USE_MODULES == 1)
		{
			$this->modules->register_class($this);
			$this->modules->on_login($member);
		}

		$this->ipsclass->admin->redirect_noscreen($this->ipsclass->vars['board_url'].'/index.'.$this->ipsclass->vars['php_ext'].'?s='.$this->ipsclass->session_id);
	}

	//-----------------------------------------
	// Output
	//-----------------------------------------

	$this->ipsclass->html .= $this->ipsclass->adskin->start_form(array(
															1 => array('code'   , 'member_snoop'),
											 				2 => array('act'    , 'mem'         ),
											 				3 => array('section', $this->ipsclass->section_code)
								   								)     );

	$this->ipsclass->html .= $this->ipsclass->adskin->start_table('Просмотр пользователя');

	$this->ipsclass->html .= "\n<tr>".
						     "\n\t<td class='tablerow1' width='30%' rowspan='2' valign='top'><strong>".(($this->ipsclass->vars['ipbli_usertype'] == 'username') ? "Имя пользователя" : "Enter email address" )."</strong></td>".
						     "\n\t<td class='tablerow2' width='70%' valign='top'>".$this->ipsclass->adskin->form_input("UserName", $_POST['UserName'])."</td>".
						     "\n</tr>";
	$this->ipsclass->html .= "\n<tr>".
						     "<td class='tablerow1'>".
						     	$this->ipsclass->adskin->form_checkbox("CookieDate", 0)."<strong>Запомнить логин?</strong>    ".
						     	$this->ipsclass->adskin->form_checkbox("Privacy", 0)."<strong>Войти скрытым?</strong>".
						     "</td>".
						     "</tr>";
	$this->ipsclass->html .= "\n<tr><td align='center' class='tablesubheader' colspan='2'><input type='submit' value='Log me in' class='realbutton' accesskey='s' /> <input type='reset' value='Reset' class='realbutton' accesskey='r' /></td></tr>";

	$this->ipsclass->html .= "</form>";
	$this->ipsclass->html .= $this->ipsclass->adskin->end_table();

	$this->ipsclass->admin->output();
}

Думаю этого будет достаточно :D

Ссылка на комментарий
Поделиться на других сайтах

Присоединиться к обсуждению

Вы можете ответить сейчас, а зарегистрироваться позже. Если у вас уже есть аккаунт, войдите, чтобы ответить от своего имени.

Гость
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Ответить на вопрос...

×   Вы вставили отформатированный текст.   Удалить форматирование

  Допустимо не более 75 смайлов.

×   Ваша ссылка была автоматически заменена на медиа-контент.   Отображать как ссылку

×   Ваши публикации восстановлены.   Очистить редактор

×   Вы не можете вставить изображения напрямую. Загрузите или вставьте изображения по ссылке.

Зарузка...
×
×
  • Создать...

Важная информация

Находясь на нашем сайте, вы соглашаетесь на использование файлов cookie, а также с нашим положением о конфиденциальности Политика конфиденциальности и пользовательским соглашением Условия использования.