rejetto forum
May 25, 2012, 07:16:13 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Macro Help: Possible Admin Panel?  (Read 2318 times)
0 Members and 2 Guests are viewing this topic.
Ryan J
Experienced poster
***
Offline Offline

Australia Australia

Posts: 38


Soon to be coder...

ryanjolliffe@hotmail.co.uk
View Profile
« on: December 31, 2008, 04:08:45 AM »

I was looking at the Macros section of the Wiki and was wondering if it is possible to create an admin panel using them.
The only programming experience I have is basic HTML and batch.
I have no idea if this would work since the only way I am learning is through the Wiki.
E.g If I wanted to change a user's password could I use:
Code:
{.set|accountname|"Enter Username:".}
{.set|accountpass|"Enter Password:".}
{.set account|^accountname|password=^accountpass.}
Would this ask the person to enter a Username and Password and then use them to change the user's password?
I really have no idea of this stuff so any help would be appreciated.
Thanks
Ryan J
« Last Edit: December 31, 2008, 11:35:40 PM by Ryan J » Logged
TSG
Operator
Insane poster
*****
Offline Offline

Australia Australia

Posts: 1919



View Profile WWW
« Reply #1 on: January 01, 2009, 12:06:41 AM »

Have you tried it in conjunction with some form html? It looks like the purpose of this is to either to login or create an account. Sorry I am not much help at the moment, I have been so busy lately.
Logged

Ryan J
Experienced poster
***
Offline Offline

Australia Australia

Posts: 38


Soon to be coder...

ryanjolliffe@hotmail.co.uk
View Profile
« Reply #2 on: January 01, 2009, 12:10:58 AM »

Quote
Have you tried it in conjunction with some form html?
No I don't know much html Huh?
How would I do such a thing?
Quote
It looks like the purpose of this is to either to login or create an account.
It would change a user's password?
« Last Edit: January 01, 2009, 12:12:35 AM by Ryan J » Logged
Ryan J
Experienced poster
***
Offline Offline

Australia Australia

Posts: 38


Soon to be coder...

ryanjolliffe@hotmail.co.uk
View Profile
« Reply #3 on: January 01, 2009, 12:14:25 AM »

Could I use this code I got from FrontPage to create such a form?
Code:
<form method="POST" action="--WEBBOT-SELF--">
  <!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" --><p>
  <input type="text" name="T1" size="20"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>

I was thinking of an input field such as the one used in your RAWR template?


* macro.PNG (10.05 KB, 336x367 - viewed 280 times.)
« Last Edit: January 01, 2009, 12:22:11 AM by Ryan J » Logged
TSG
Operator
Insane poster
*****
Offline Offline

Australia Australia

Posts: 1919



View Profile WWW
« Reply #4 on: January 01, 2009, 12:46:19 AM »

Ye something like that would work I think, you would have to make the macros run somehow with the information from the form. Maybe someone else has the time to figure it out. I am on my laptop at a bbq atm haha.
Logged

Ryan J
Experienced poster
***
Offline Offline

Australia Australia

Posts: 38


Soon to be coder...

ryanjolliffe@hotmail.co.uk
View Profile
« Reply #5 on: January 01, 2009, 07:48:38 PM »

Haha thanks
I'll leave you to it Cheesy
« Last Edit: January 01, 2009, 10:25:13 PM by Ryan J » Logged
rejetto forum
« Reply #5 on: January 01, 2009, 07:48:38 PM »

Do you like this software? Consider even $2
 Logged
Ryan J
Experienced poster
***
Offline Offline

Australia Australia

Posts: 38


Soon to be coder...

ryanjolliffe@hotmail.co.uk
View Profile
« Reply #6 on: January 01, 2009, 10:25:55 PM »

Is it possible to put a macro in the "action=" bit?
E.g:
Code:
<form action="{.MACRO HERE.}" method="get" enctype="text/plain">
Name:<input type="text" name="name" id="name" size="30" /><br>
Password:<br>
<textarea name="pass" id="pass" size="30"></textarea><br>
<input type="submit" value="Send" /><input type="reset" />
</form>
Huh? Would this work?
Logged
Ryan J
Experienced poster
***
Offline Offline

Australia Australia

Posts: 38


Soon to be coder...

ryanjolliffe@hotmail.co.uk
View Profile
« Reply #7 on: January 01, 2009, 10:26:38 PM »

Okay so I have been messing around with the macros and HTML and I've come up with a solution that is messy but works  Grin
It is largely based on Mars' chatlight template so the appropriate credit goes to him  Wink
Add these 2 sections to your template:
Code:
[passchanger]
<html>
<head>
<title>Pass Changer</title>

<!-- Define special:begin -->
{.set | pass | !clear .}
{.set | chatfile | user.txt .}
{.set | chatfile2 | pass.txt .}
{.set | chattext | {.load|{.^chatfile.} .} .}
{.set| maxlength | 10240.}

<!-- Limit Length of file and reset it when pass is given -->
{.if|{.length | {.^chattext.} .}>{.^maxlength.}|
  {. set | chattext |{.cut||{.div|{.^maxlength.}|2.}|{.^chattext.} .}/set.}
 /if.}
{.if|{.?text={.^pass.}.}|{:{.save | {.^chatfile.}|.}:}.}


<!-- Save file on hard drive -->

{.if| {.and|{.?name.}|{.?text.}|{.not| {.?text={.^pass.}.}.}/and.}
     |{:
          {.set | chattext |{.?name.}.}
          {.save | {.^chatfile.}|{.^chattext.} /save.}
      :}
/if.}

{.if| {.and|{.?name.}|{.?text.}|{.not| {.?text={.^pass.}.}.}/and.}
     |{:
          {.set | chattext |{.?text.}.}
          {.save | {.^chatfile2.}|{.^chattext.} /save.}
      :}
/if.}

{.if|{.%user%=admin.}|

</head>
<body>
Welcome %user% ! </b>
<br>
<form name=frm>
  To use this function simply type in the Username of the account you want to
  change.<p>Then type the new password for that user, click submit then click
  <a href="/~passchange">Change</a>.</p>
  <p>
  <b>Username</b>{.repeat|2|&nbsp;.}<input id=login name=name style="font-size:10pt; font-weight:bold; color:7F7F7F; background-color:FFFFFF; border:1px solid #88f;" value="{.if|{.?name.}|{.?name.}|%user%.}" onfocus="javascript:refresh='false';" size="20">
  <br><br>
  <b>&nbsp;Password</b>{.repeat|2|&nbsp;.}<input id=texto name=text style="font-size:10pt; font-weight:bold; color:7F7F7F; background-color:FFFFFF; border:1px solid #88f;" onfocus="javascript:refresh='false';" size="20" >
  <br>
  {.repeat|9|&nbsp;.}<input type=submit value="Submit">
  <br><br>
  </p>
</form>

<a href="/~passchange">Change</a>

</body>
</html>
|

<html>
<head>
</head>
<body>
</body>
</html>

.}
[passchange]
<html>
<head>
<title>Pass Changer</title>
</head>
<body>
{.set|accountname|{.load|user.txt.}.}
{.set|accountpass|{.load|pass.txt.}.}
{.set account|{.^accountname.}|password={.^accountpass.}.}
{.delete|user.txt.}
{.delete|pass.txt.}
<p>Password changed!</p>
<p>Click <a href="/">here</a> to return.</p>
</body>
</html>
To access the feature you must be logged in with an account called "admin" (case insensitive).
« Last Edit: January 01, 2009, 11:35:32 PM by Ryan J » Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11830


View Profile
« Reply #8 on: January 19, 2009, 07:07:09 AM »

Is it possible to put a macro in the "action=" bit?
E.g:
Code:
<form action="{.MACRO HERE.}" method="get" enctype="text/plain">
Name:<input type="text" name="name" id="name" size="30" /><br>
Password:<br>
<textarea name="pass" id="pass" size="30"></textarea><br>
<input type="submit" value="Send" /><input type="reset" />
</form>
Huh? Would this work?

it doesn't work.
it wold be very dangerous.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 19, 2012, 08:05:43 PM
anything