From fd3f2cbdaa1e3c160727c3cf09ef03d06174c114 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 18 Sep 2008 21:59:23 +0000 Subject: Series: Removed Series component Refs #57 --- series/trunk/admin/addsub.php | 129 -------------------------------- series/trunk/admin/adduser.php | 110 --------------------------- series/trunk/admin/chpwd.php | 134 --------------------------------- series/trunk/admin/deletesub.php | 71 ------------------ series/trunk/admin/deleteuser.php | 49 ------------- series/trunk/admin/editsub.php | 151 -------------------------------------- series/trunk/admin/login.php | 95 ------------------------ series/trunk/admin/logout.php | 26 ------- series/trunk/admin/main.php | 32 -------- series/trunk/admin/mansub.php | 45 ------------ series/trunk/admin/manuser.php | 46 ------------ 11 files changed, 888 deletions(-) delete mode 100644 series/trunk/admin/addsub.php delete mode 100644 series/trunk/admin/adduser.php delete mode 100644 series/trunk/admin/chpwd.php delete mode 100644 series/trunk/admin/deletesub.php delete mode 100644 series/trunk/admin/deleteuser.php delete mode 100644 series/trunk/admin/editsub.php delete mode 100644 series/trunk/admin/login.php delete mode 100644 series/trunk/admin/logout.php delete mode 100644 series/trunk/admin/main.php delete mode 100644 series/trunk/admin/mansub.php delete mode 100644 series/trunk/admin/manuser.php (limited to 'series/trunk/admin') diff --git a/series/trunk/admin/addsub.php b/series/trunk/admin/addsub.php deleted file mode 100644 index 4fdd907..0000000 --- a/series/trunk/admin/addsub.php +++ /dev/null @@ -1,129 +0,0 @@ - 0) - { - showForm($_POST['id'], $_POST['title'], $_POST['url'], $_POST['category'], $_POST['password'], $errors); - } else { - instaDisc_initSubscription($_SESSION['username'], $_POST['id'], $_POST['url'], $_POST['title'], $_POST['category'], $_POST['password']); - - $template = new FITemplate('addedsub'); - $template->add('SITENAME', instaDisc_getConfig('siteName')); - $template->display(); - } -} - -function showForm($id, $title, $url, $category, $password, $errors) -{ - $template = new FITemplate('addsub'); - $template->add('SITENAME', instaDisc_getConfig('siteName')); - - if (isset($errors[1])) - { - $template->adds_block('ERROR', array('ex'=>'1')); - - foreach ($errors as $name => $value) - { - $template->adds_block('ERRORS', array( 'NAME' => $name, - 'MSG' => $value['msg'])); - } - } - - $template->add('ID_ERR', ifErrors($errors, 'id')); - $template->add('TITLE_ERR', ifErrors($errors, 'title')); - $template->add('URL_ERR', ifErrors($errors, 'url')); - $template->add('CATEGORY_ERR', ifErrors($errors, 'category')); - $template->add('PASSWORD_ERR', ifErrors($errors, 'password')); - - doErrors($template, $errors, 'id'); - doErrors($template, $errors, 'title'); - doErrors($template, $errors, 'url'); - doErrors($template, $errors, 'category'); - doErrors($template, $errors, 'password'); - - $template->add('ID', $id); - $template->add('TITLE', $title); - $template->add('URL', $url); - $template->add('CATEGORY', $category); - $template->add('PASSWORD', $password); - - $template->display(); -} - -function ifErrors($errors, $id) -{ - foreach ($errors as $name => $value) - { - if ($value['field'] == $id) - { - return ' error'; - } - } - - return ''; -} - -function doErrors($template, $errors, $id) -{ - foreach ($errors as $name => $value) - { - if ($value['field'] == $id) - { - $template->adds_block(strtoupper($id) . '_ERRS', array( 'NAME' => $name, - 'VALUE' => $value['msg'])); - } - } -} - -function addError(&$numOfErrors, &$errors, $field, $msg) -{ - $numOfErrors++; - $errors[$numOfErrors] = array('field' => $field, 'msg' => $msg); -} - -?> diff --git a/series/trunk/admin/adduser.php b/series/trunk/admin/adduser.php deleted file mode 100644 index dcad5d5..0000000 --- a/series/trunk/admin/adduser.php +++ /dev/null @@ -1,110 +0,0 @@ - 0) - { - showForm($_POST['username'], $_POST['password'], $errors); - } else { - instaDisc_addUser($_POST['username'], $_POST['password']); - - $template = new FITemplate('addeduser'); - $template->add('SITENAME', instaDisc_getConfig('siteName')); - $template->display(); - } -} - -function showForm($username, $password, $errors) -{ - $template = new FITemplate('adduser'); - $template->add('SITENAME', instaDisc_getConfig('siteName')); - - if (isset($errors[1])) - { - $template->adds_block('ERROR', array('ex'=>'1')); - - foreach ($errors as $name => $value) - { - $template->adds_block('ERRORS', array( 'NAME' => $name, - 'MSG' => $value['msg'])); - } - } - - $template->add('USERNAME_ERR', ifErrors($errors, 'username')); - $template->add('PASSWORD_ERR', ifErrors($errors, 'password')); - - doErrors($template, $errors, 'username'); - doErrors($template, $errors, 'password'); - - $template->add('USERNAME', $username); - $template->add('PASSWORD', $password); - - $template->display(); -} - -function ifErrors($errors, $id) -{ - foreach ($errors as $name => $value) - { - if ($value['field'] == $id) - { - return ' error'; - } - } - - return ''; -} - -function doErrors($template, $errors, $id) -{ - foreach ($errors as $name => $value) - { - if ($value['field'] == $id) - { - $template->adds_block(strtoupper($id) . '_ERRS', array( 'NAME' => $name, - 'VALUE' => $value['msg'])); - } - } -} - -function addError(&$numOfErrors, &$errors, $field, $msg) -{ - $numOfErrors++; - $errors[$numOfErrors] = array('field' => $field, 'msg' => $msg); -} - -?> diff --git a/series/trunk/admin/chpwd.php b/series/trunk/admin/chpwd.php deleted file mode 100644 index 12eff53..0000000 --- a/series/trunk/admin/chpwd.php +++ /dev/null @@ -1,134 +0,0 @@ - 0) - { - showForm($_POST['old'], $_POST['new'], $_POST['confirm'], $errors); - } else { - instaDisc_changePassword($_SESSION['username'], $_POST['new']); - - $template = new FITemplate('changedpassword'); - $template->add('SITENAME', instaDisc_getConfig('siteName')); - $template->display(); - } - } -} else { - header('Location: index.php'); - exit; -} - -function showForm($old, $new, $confirm, $errors) -{ - $template = new FITemplate('changepassword'); - $template->add('SITENAME', instaDisc_getConfig('siteName')); - - if (isset($errors[1])) - { - $template->adds_block('ERROR', array('ex'=>'1')); - - foreach ($errors as $name => $value) - { - $template->adds_block('ERRORS', array( 'NAME' => $name, - 'MSG' => $value['msg'])); - } - } - - $template->add('OLD_ERR', ifErrors($errors, 'old')); - $template->add('NEW_ERR', ifErrors($errors, 'new')); - $template->add('CONFIRM_ERR', ifErrors($errors, 'confirm')); - - doErrors($template, $errors, 'old'); - doErrors($template, $errors, 'new'); - doErrors($template, $errors, 'confirm'); - - $template->add('OLD', $old); - $template->add('NEW', $new); - $template->add('CONFIRM', $confirm); - - $template->display(); -} - -function ifErrors($errors, $id) -{ - foreach ($errors as $name => $value) - { - if ($value['field'] == $id) - { - return ' error'; - } - } - - return ''; -} - -function doErrors($template, $errors, $id) -{ - foreach ($errors as $name => $value) - { - if ($value['field'] == $id) - { - $template->adds_block(strtoupper($id) . '_ERRS', array( 'NAME' => $name, - 'VALUE' => $value['msg'])); - } - } -} - -function addError(&$numOfErrors, &$errors, $field, $msg) -{ - $numOfErrors++; - $errors[$numOfErrors] = array('field' => $field, 'msg' => $msg); -} - -?> diff --git a/series/trunk/admin/deletesub.php b/series/trunk/admin/deletesub.php deleted file mode 100644 index 102a6a3..0000000 --- a/series/trunk/admin/deletesub.php +++ /dev/null @@ -1,71 +0,0 @@ -add('SITENAME',instaDisc_getConfig('siteName')); - $template->add('ID',$_GET['subid']); - - $sub = instaDisc_getSubscriptionByID($_GET['subid']); - $template->add('IDENTITY',$sub['identity']); - $template->display(); -} else { - if ($_POST['submit'] == 'Yes') - { - instaDisc_deleteSubscription($_POST['id']); - - $template = new FITemplate('deletedsub'); - $template->display(); - } else { - header('Location: admin.php?id=main'); - } -} - -?> diff --git a/series/trunk/admin/deleteuser.php b/series/trunk/admin/deleteuser.php deleted file mode 100644 index 7d1b0a0..0000000 --- a/series/trunk/admin/deleteuser.php +++ /dev/null @@ -1,49 +0,0 @@ -add('SITENAME',instaDisc_getConfig('siteName')); - $template->add('ID',$_GET['userid']); - - $sub = instaDisc_getUserByID($_GET['userid']); - $template->add('USERNAME',$sub['username']); - $template->display(); -} else { - if ($_POST['submit'] == 'Yes') - { - instaDisc_deleteUser($_POST['id']); - - $template = new FITemplate('deleteduser'); - $template->display(); - } else { - header('Location: admin.php?id=main'); - } -} - -?> diff --git a/series/trunk/admin/editsub.php b/series/trunk/admin/editsub.php deleted file mode 100644 index e49a971..0000000 --- a/series/trunk/admin/editsub.php +++ /dev/null @@ -1,151 +0,0 @@ - 0) - { - showForm($_POST['id'], $_POST['title'], $_POST['url'], $_POST['category'], $_POST['password'], $errors); - } else { - instaDisc_initSubscription($_SESSION['username'], $_POST['id'], $_POST['url'], $_POST['title'], $_POST['category'], $_POST['password']); - - $template = new FITemplate('editedsub'); - $template->add('SITENAME', instaDisc_getConfig('siteName')); - $template->display(); - } -} - -function showForm($id, $title, $url, $category, $password, $errors) -{ - $template = new FITemplate('editsub'); - $template->add('SITENAME', instaDisc_getConfig('siteName')); - - if (isset($errors[1])) - { - $template->adds_block('ERROR', array('ex'=>'1')); - - foreach ($errors as $name => $value) - { - $template->adds_block('ERRORS', array( 'NAME' => $name, - 'MSG' => $value['msg'])); - } - } - - $template->add('TITLE_ERR', ifErrors($errors, 'title')); - $template->add('URL_ERR', ifErrors($errors, 'url')); - $template->add('CATEGORY_ERR', ifErrors($errors, 'url')); - $template->add('PASSWORD_ERR', ifErrors($errors, 'url')); - - doErrors($template, $errors, 'title'); - doErrors($template, $errors, 'url'); - doErrors($template, $errors, 'category'); - doErrors($template, $errors, 'password'); - - $template->add('ID', $id); - $template->add('TITLE', $title); - $template->add('URL', $url); - $template->add('CATEGORY', $category); - $template->add('PASSWORD', $password); - - $template->display(); -} - -function ifErrors($errors, $id) -{ - foreach ($errors as $name => $value) - { - if ($value['field'] == $id) - { - return ' error'; - } - } - - return ''; -} - -function doErrors($template, $errors, $id) -{ - foreach ($errors as $name => $value) - { - if ($value['field'] == $id) - { - $template->adds_block(strtoupper($id) . '_ERRS', array( 'NAME' => $name, - 'VALUE' => $value['msg'])); - } - } -} - -function addError(&$numOfErrors, &$errors, $field, $msg) -{ - $numOfErrors++; - $errors[$numOfErrors] = array('field' => $field, 'msg' => $msg); -} - -?> diff --git a/series/trunk/admin/login.php b/series/trunk/admin/login.php deleted file mode 100644 index fe394a1..0000000 --- a/series/trunk/admin/login.php +++ /dev/null @@ -1,95 +0,0 @@ -add('SITENAME', instaDisc_getConfig('siteName')); - $template->display(); - } else { - addError($numOfErrors, $errors, '', 'Account could not be found'); - showForm($_POST['username'], $_POST['password'], $errors); - } -} - -function showForm($username, $password, $errors) -{ - $template = new FITemplate('login'); - $template->add('SITENAME', instaDisc_getConfig('siteName')); - - if (isset($errors[1])) - { - $template->adds_block('ERROR', array('ex'=>'1')); - - foreach ($errors as $name => $value) - { - $template->adds_block('ERRORS', array( 'NAME' => $name, - 'MSG' => $value['msg'])); - } - } - - $template->add('USERNAME_ERR', ifErrors($errors, 'username')); - $template->add('PASSWORD_ERR', ifErrors($errors, 'password')); - - doErrors($template, $errors, 'username'); - doErrors($template, $errors, 'password'); - - $template->add('USERNAME', $username); - $template->add('PASSWORD', $password); - - $template->display(); -} - -function ifErrors($errors, $id) -{ - foreach ($errors as $name => $value) - { - if ($value['field'] == $id) - { - return ' error'; - } - } - - return ''; -} - -function doErrors($template, $errors, $id) -{ - foreach ($errors as $name => $value) - { - if ($value['field'] == $id) - { - $template->adds_block(strtoupper($id) . '_ERRS', array( 'NAME' => $name, - 'VALUE' => $value['msg'])); - } - } -} - -function addError(&$numOfErrors, &$errors, $field, $msg) -{ - $numOfErrors++; - $errors[$numOfErrors] = array('field' => $field, 'msg' => $msg); -} - -?> diff --git a/series/trunk/admin/logout.php b/series/trunk/admin/logout.php deleted file mode 100644 index 779a1d2..0000000 --- a/series/trunk/admin/logout.php +++ /dev/null @@ -1,26 +0,0 @@ - diff --git a/series/trunk/admin/main.php b/series/trunk/admin/main.php deleted file mode 100644 index 9318a5d..0000000 --- a/series/trunk/admin/main.php +++ /dev/null @@ -1,32 +0,0 @@ -add('SITENAME',instaDisc_getConfig('siteName')); - -if (instaDisc_isAdmin($_SESSION['username'])) -{ - $template->adds_block('ADMIN', array('exi'=>1)); -} - -$template->display(); - -?> diff --git a/series/trunk/admin/mansub.php b/series/trunk/admin/mansub.php deleted file mode 100644 index 6ad04ac..0000000 --- a/series/trunk/admin/mansub.php +++ /dev/null @@ -1,45 +0,0 @@ -add('SITENAME', instaDisc_getConfig('siteName')); - -if (instaDisc_isAdmin($_SESSION['username'])) -{ - $subs = instaDisc_getAllSubscriptions(); -} else { - $subs = instaDisc_listSubscriptions($_SESSION['username']); -} -$i=0; $j=0; -for ($i=0;isset($subs[$i]);$i++) -{ - $j++; -} -$j--; -for ($i=0;$i<$j;$i++) -{ - $template->adds_block('SUBSCRIPTIONS', array( 'IDENTITY' => $subs[$i]['identity'], - 'ID' => $subs[$i]['id'])); -} - -$template->display(); - -?> diff --git a/series/trunk/admin/manuser.php b/series/trunk/admin/manuser.php deleted file mode 100644 index 4228a36..0000000 --- a/series/trunk/admin/manuser.php +++ /dev/null @@ -1,46 +0,0 @@ -add('SITENAME', instaDisc_getConfig('siteName')); - -if (instaDisc_isAdmin($_SESSION['username'])) -{ - $users = instaDisc_getAllUsers(); -} else { - header('Location: index.php'); - exit; -} -$i=0; $j=0; -for ($i=0;isset($users[$i]);$i++) -{ - $j++; -} -$j--; -for ($i=0;$i<$j;$i++) -{ - $template->adds_block('USERS', array( 'USERNAME' => $users[$i]['username'], - 'ID' => $users[$i]['id'])); -} - -$template->display(); - -?> -- cgit 1.4.1