// this is a comment:this page is restricted to domain "admin"; // if user is not in the domain "admin" user is prompted to login. domain admin; // semicolon or end of line terminates a statement;' if domain="new_pswd" ;// if using default-password "Access Denied
";// deny access over ;// abort script endif if form(select) ;// if a user has been selected goto show the details; goto showuser ;// caravan goto statement followed by label name; elseif form(userdo);// if an action is selected do the action; goto douser endif // display the user list user x;// x is an instance of caravan user; has default properties of logged in user "Logged in user ";x(username); "
"; //display the current user's name // x(total) access the total property of x ; which is the total number of caravan users'

Total x(total);//caravan script can be inserted anywhere! users

// each caravan user has a uid which is a unique number;setting it to 0 brings us to the head of the list // otherwise the list begins with the logged in user. only admin domain has previlege to set uid x(uid)="0" loop ul (x(total)) ; // this is a caravan loop statement; ends with repeat; // ul is the name of the loop object // syntax : loop () ; "here x(total)" which gives total users // loop statement is followed by any number of statements ""; "" "";// userid iu the login name "" "";// x(link) is a numeric property that can be set by applications to link the user to more info "";//x(ftphome) gives the users ftpo home directory; user cant use ftp if this is not set "\r\n" x(next);// select next user repeat ul 512;;//loop ul ends; max iterations 512 ; // caravan loops end with repeat statement followed by // the loop name and a constant numeric value "
UsernameLoginDomainLinkFtpHome
";x(username);"";x(userid);""; loop dl (x(domain(00)));// another loop dl to unravel the number of "domains" a user has x(domain(dl(count)));"
" repeat dl 8;// end loop dl -- repeats maximum of 8 times "
";x(link);"";x(ftphome);"
" over ;// user listing done // show select user information; jumps from top label showuser;// jump point for "goto showuser" user x x(uid)=form(select) if x(uid)=form(select) "

User ";x(userid);"

" "
" "" "" "" "" "" "\r\n" "
Username
FtpHome
Domain
use '|' to seperate multiple values
<\body>" endif over label douser;// jump point for "goto douser" user x x(uid)=form(uid) if form(userdo)="delete user" if x(link) "

Cannot delete this user

" "This user is linked to some application, Please click here for user list." else "

User ";x(username);" is going to be deleted

" "
" endif elseif form(userdo)="set default password" if x(uid)=form(uid) "ok password reset" x(password)="password";// password will be set to "password" only // This sets the user's password to default value "password"; // Only the logged-in user can change his own password to something else ie: // x(password)="mypass"; will set password to "mypass" if x represents the // current user; so it is possible write a script which allows the user // change his/her password. // Only admin can change other users' password or data; // The admin can only reset the password to "password" not anything else endif elseif form(userdo)="confirm delete" if x(uid)=form(uid) x(delete) redirect "user.html" endif elseif form(userdo)="modify user" if x(uid)=form(uid) x(username)=form(username) x(domain)="null" x(domain)=form(domain) x(ftphome)=form(ftphome) redirect "user.html" endif endif "
"