* the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ if (isset($_POST['sublogin'])) { $user = new User(); $frmErr = $user->authUser($_POST['user'], $_POST['pass']); if ($frmErr['lvl'] == 1) { $user->populateUser($frmErr['uid']); $_SESSION['user'] = $user; } } get_top_nav(); //Call the navigation ?> <div id="wrap"> <div id="widecb" > <?php /* * We check if the user is logged in *
return $res[0]; } return false; } public function logout() { } public function listUser($col = '*', $cond = '1 = 1', $onlyActive = true) { $this->q = 'select ' . $col . ' from user where ' . $cond; if ($onlyActive == true) { $this->q .= ' and status = 1'; } $ps = $this->db->prepare($this->q); $data = array(); $ps->execute($data); echo $this->q; return $ps->fetchAll(); // default PDO::FETCH_BOTH } public function editUser() { } } // $dataInput = array('email'=>'*****@*****.**', // 'passwd'=>'rahasiabersama', // 'fullname'=>'Nama Saya', 'level'=>'1'); $user = new User(); // $user->register($dataInput); $login = $user->authUser('*****@*****.**', 'rahasiabersama'); print_r($login);