Configure the new TinyMCE to have almost the same buttons as the old one.
Configure the new TinyMCE to have almost the same buttons as the old one.

File last commit:

2f20c7105050
3cf3f8fd35f8
Show More
user.php
35 lines | 1.5 KiB | text/x-php | PhpLexer
Add most necessary files for admin interface.
r1 <?php
$currentuser=false;
function getCurrentUser() {
global $currentuser;
echo $currentuser->name;
}
function get_userdatabyid( $id ) {
Update include/*.php to use mysqli_* functions.
r4 global $mtdb;
Add most necessary files for admin interface.
r1 return $mtdb->getRow( 'SELECT id,name,email,nameplate,default_image,default_link FROM contributor WHERE id = ' . (int)$id );
}
function get_userdatabylogin( $username ) {
global $mtdb;
Update include/*.php to use mysqli_* functions.
r4 return $mtdb->getRow( 'SELECT id,name,email,nameplate,default_image,default_link FROM contributor WHERE name = "' . mysqli_real_escape_string($mtdb->link, $username) . '"' );
Add most necessary files for admin interface.
r1 }
function save_userdata( $user ) {
adminlog("Saved changes to user ".$user->id." (".$user->name.").", MTS_USER, MTA_UPDATE);
global $mtdb;
return $mtdb->query( sprintf( 'UPDATE contributor SET email="%s", nameplate="%s", default_image="%s", default_link="%s" WHERE id=%d',
Update include/*.php to use mysqli_* functions.
r4 mysqli_real_escape_string($mtdb->link, $user->email), mysqli_real_escape_string($mtdb->link, $user->nameplate),
mysqli_real_escape_string($mtdb->link, $user->default_image), mysqli_real_escape_string($mtdb->link, $user->default_link), $user->id) );
Add most necessary files for admin interface.
r1 }
function change_password( $user ) {
adminlog("Changed password for user ".$user->id." (".$user->name.").", MTS_USER, MTA_UPDATE);
global $mtdb, $currentuser;
if( $currentuser->id === $user->id ) mt_setcookie($user->name, $user->password, false, ADMINURL, FALSE );
Update include/*.php to use mysqli_* functions.
r4 return $mtdb->query( 'UPDATE contributor SET password=SHA1( "' . mysqli_real_escape_string($mtdb->link, $user->password) . '" ) WHERE id = "' . mysqli_real_escape_string($mtdb->link, $user->id) . '"' );
Add most necessary files for admin interface.
r1 }
?>