Vergleich newreply.php - 1.4.1 - 1.4.4

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: newreply.php 4081 2008-08-08 01:47:02Z Tikitiki $

 * $Id: newreply.php 4277 2008-11-23 20:47:16Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 136Zeile 136
	}
elseif($mybb->input['previewpost'])
{

	}
elseif($mybb->input['previewpost'])
{

		$username = $mybb->input['username'];

		$username = htmlspecialchars_uni($mybb->input['username']);

	}
eval("\$loginbox = \"".$templates->get("loginbox")."\";");

	}
eval("\$loginbox = \"".$templates->get("loginbox")."\";");

}


}


// Check to see if the thread is closed, and if the user is a mod.
if(!is_moderator($fid, "caneditposts"))
{

// Check to see if the thread is closed, and if the user is a mod.
if(!is_moderator($fid, "caneditposts"))
{

Zeile 152Zeile 152

// No weird actions allowed, show new reply form if no regular action.
if($mybb->input['action'] != "do_newreply" && $mybb->input['action'] != "editdraft")


// No weird actions allowed, show new reply form if no regular action.
if($mybb->input['action'] != "do_newreply" && $mybb->input['action'] != "editdraft")

{
$mybb->input['action'] = "newreply";
}

{
$mybb->input['action'] = "newreply";
}


// Even if we are previewing, still show the new reply form.
if($mybb->input['previewpost'])


// Even if we are previewing, still show the new reply form.
if($mybb->input['previewpost'])

{

{

	$mybb->input['action'] = "newreply";

	$mybb->input['action'] = "newreply";

}

}


if((empty($_POST) && empty($_FILES)) && $mybb->input['processed'] == '1')
{


if((empty($_POST) && empty($_FILES)) && $mybb->input['processed'] == '1')
{

Zeile 168Zeile 168
}

if(!$mybb->input['attachmentaid'] && ($mybb->input['newattachment'] || ($mybb->input['action'] == "do_newreply" && $mybb->input['submit'] && $_FILES['attachment'])))

}

if(!$mybb->input['attachmentaid'] && ($mybb->input['newattachment'] || ($mybb->input['action'] == "do_newreply" && $mybb->input['submit'] && $_FILES['attachment'])))

{
// If there's an attachment, check it and upload it.
if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0)












{
if($mybb->input['action'] == "editdraft" || ($mybb->input['tid'] && $mybb->input['pid']))
{
$attachwhere = "pid='{$pid}'";
}
else
{
$attachwhere = "posthash='".$db->escape_string($mybb->input['posthash'])."'";
}
$query = $db->simple_select("attachments", "COUNT(aid) as numattachs", $attachwhere);
$attachcount = $db->fetch_field($query, "numattachs");

// If there's an attachment, check it and upload it
if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0 && ($mybb->settings['maxattachments'] == 0 || $attachcount < $mybb->settings['maxattachments']))

	{
require_once MYBB_ROOT."inc/functions_upload.php";
$attachedfile = upload_attachment($_FILES['attachment']);

	{
require_once MYBB_ROOT."inc/functions_upload.php";
$attachedfile = upload_attachment($_FILES['attachment']);

	}


	}


	if($attachedfile['error'])
{
eval("\$attacherror = \"".$templates->get("error_attacherror")."\";");
$mybb->input['action'] = "newreply";
}

	if($attachedfile['error'])
{
eval("\$attacherror = \"".$templates->get("error_attacherror")."\";");
$mybb->input['action'] = "newreply";
}

 
	

	if(!$mybb->input['submit'])
{
$mybb->input['action'] = "newreply";

	if(!$mybb->input['submit'])
{
$mybb->input['action'] = "newreply";

Zeile 202Zeile 215
{
mt_srand ((double) microtime() * 1000000);
$mybb->input['posthash'] = md5($thread['tid'].$mybb->user['uid'].mt_rand());

{
mt_srand ((double) microtime() * 1000000);
$mybb->input['posthash'] = md5($thread['tid'].$mybb->user['uid'].mt_rand());

}

}


$reply_errors = "";
$hide_captcha = false;


$reply_errors = "";
$hide_captcha = false;

Zeile 250Zeile 263
			if(!$mybb->user['uid'])
{
my_setcookie('loginattempts', $logins + 1);

			if(!$mybb->user['uid'])
{
my_setcookie('loginattempts', $logins + 1);

				$db->write_query("UPDATE ".TABLE_PREFIX."sessions SET loginattempts=loginattempts+1 WHERE sid = '{$session->sid}'");

				$db->write_query("UPDATE ".TABLE_PREFIX."users SET loginattempts=loginattempts+1 WHERE username = '".$db->escape_string($mybb->input['username'])."'");

				if($mybb->settings['failedlogintext'] == 1)
{
$login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);

				if($mybb->settings['failedlogintext'] == 1)
{
$login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);

				}				

				}		

				error($lang->error_invalidpassword.$login_text);
}
// Otherwise they've logged in successfully.

				error($lang->error_invalidpassword.$login_text);
}
// Otherwise they've logged in successfully.

Zeile 266Zeile 279
			// Update the session to contain their user ID
$updated_session = array(
"uid" => $mybb->user['uid'],

			// Update the session to contain their user ID
$updated_session = array(
"uid" => $mybb->user['uid'],

				"loginattempts" => 0

 
			);
$db->update_query("sessions", $updated_session, "sid='{$session->sid}'");

			);
$db->update_query("sessions", $updated_session, "sid='{$session->sid}'");

 

$db->update_query("users", array("loginattempts" => 1), "uid='{$mybb->user['uid']}'");


// Set uid and username
$uid = $mybb->user['uid'];


// Set uid and username
$uid = $mybb->user['uid'];

Zeile 445Zeile 459
		else
{
// Moderated post

		else
{
// Moderated post

			$lang->redirect_newreply .= $lang->redirect_newreply_moderation;

			$lang->redirect_newreply .= '<br />'.$lang->redirect_newreply_moderation;

			$url = get_thread_link($tid);
}


			$url = get_thread_link($tid);
}