X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=metaform%2Ftemplate.php;h=5f59c6de9cc504db573cabdecf7be6d7f2b78a4f;hb=1c6e9a5776476a1c6f8c5ace08ceaba64ffa05eb;hp=aed60548f9fc19dcfaa23bf4653909e94f46647b;hpb=75be750e3413ca96736f78adcfdc8fcf7db9f91e;p=wfpl.git diff --git a/metaform/template.php b/metaform/template.php index aed6054..5f59c6d 100644 --- a/metaform/template.php +++ b/metaform/template.php @@ -31,12 +31,7 @@ $GLOBALS['~name~_max_height'] = '400'; $GLOBALS['~name~_thumb_max_width'] = '70'; $GLOBALS['~name~_thumb_max_height'] = '70'; $GLOBALS['~name~_file_name'] = uniqid() . getmypid() . '.jpg'; # comment this out to use uploader's filename - -# Define the username and password required to view this form: -define('AUTH_REALM', '~file_name~ administration area'); -define('AUTH_USER', 'fixme'); -define('AUTH_PASS', 'fixme'); - + require_once('code/wfpl/template.php'); require_once('code/wfpl/format.php'); @@ -133,13 +128,10 @@ function ~file_name~_display_main() { function ~file_name~_edit_main() { -function _~file_name~_main() { - # To remove password protection, just delete this block: - if (!isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] != AUTH_USER || $_SERVER['PHP_AUTH_PW'] != AUTH_PASS) { - header('WWW-Authenticate: Basic realm="' . AUTH_REALM . '"'); - header('HTTP/1.0 401 Unauthorized'); - echo '401 Unauthorized'; - exit; +function _~file_name~_main() { + if(!logged_in_as_admin()) { + $GLOBALS['url'] = this_url(); + return 'admin_login'; } pulldown('~name~', array('option 1', 'option 2', 'option 3'));