View Full Version : makeinputcode
fox_m
01-30-2003, 08:20 PM
Hi all
I have an question ....
I want to make sureten input boxes nonediteble for the user
what do i need to add to the makeinputcode() to make that happen ??
I have for example this
doformheader("change_password","update");
maketableheader("Update htaccess user Password");
makeinputcode("User Name","ausername",$row[0]);
makeinputcode("Password","apassword");
doformfooter("Save");
which allows admin users update there htaccess password but i dont want admins update other admins htaccess passwords
$row[0] contains the username that is logged in onto the admin cp
Look in adminfunctions.php for makeinputcode() function, your answer is there.
fox_m
02-11-2003, 09:49 PM
Sorry for my very late reaction but i couldnt do sooner.
anyway i have looked at the adminfuntions.php but i cant make out what i need to add so the box is not editeble anymore
Here is a snippet from the adminfuntions.php
// ###################### Start makeinputcode #######################
function makeinputcode ($title,$name,$value="",$htmlise=1,$size=35) {
// makes code for an imput box: first column contains $title
// second column contains an input box of name, $name and value, $value. $value is "HTMLised"
if ($htmlise) {
$value=htmlspecialchars($value);
}
echo "<tr class='".getrowbg()."' valign='top'>\n<td><p>$title</p></td>\n<td><p><input type=\"text\" size=\"$size\" name=\"$name\" value=\"$value\"></p></td>\n</tr>\n";
}
So help is still appriciated :)
Thnx
Fox_m
Erwin
02-11-2003, 10:07 PM
Try this:
if ($bbuserinfo[userid]==$userid) {
doformheader("change_password","update");
maketableheader("Update htaccess user Password");
makeinputcode("User Name","ausername",$row[0]);
makeinputcode("Password","apassword");
doformfooter("Save");
}
This way, if you are an admin, and want to edit yourself, that section will show. But the variables will be uneditable if you are trying to edit another admin. Should work...
fox_m
02-11-2003, 10:44 PM
I have tryed this.
doformheader("change_password","update");
if ($bbuserinfo[userid]==$userid) {
maketableheader("Update htaccess user Password");
makeinputcode("User Name","ausername",$row[0]);
makeinputcode("Password","apassword");
} else {
makehiddencode("User Name","ausername");
makehiddencode("Password","apassword");
}
doformfooter("Save");
but that is giving me only the save and the reset button.
also i noticed that the snippet posted here differs from what i recieved by email.
Which is the above code ...
Erwin
02-12-2003, 12:13 AM
Use the code in my post here.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.