function loginAction() { //如果已经登陆 跳转 //判断登陆 if (isset($_POST['submit']) && $_SERVER['REQUEST_METHOD'] == 'POST') { if (AuthUser::login($_POST['username'], $_POST['password'])) { //监听 记录日志 //如果有记录URL则跳转 //跳转到来源页面 //header('location:index.php?job=admin_article'); //暂时测试用的跳转 go_redirect('index.php?job=admin_article'); //echo '<font color=green>Success</font>'; } else { //否则记录用户名 //提示登陆失败 //echo '<font color=red>Please try again</font>'; header('location:index.php?job=login'); } //如果没找到url活密码 } }
/** * 批量移动文章 * @param <type> $args */ public function batch_moveAction($args = null) { //move update cid $post_checked = isset($_POST['checked']) ? $_POST['checked'] : null; $newcid = isset($_POST['newcid']) ? $_POST['newcid'] : null; if (is_array($post_checked) && count($post_checked) > 0) { $id_arr = array(); foreach ($post_checked as $val) { $data = unserialize(base64_decode($val)); if ($data->cid != $newcid) { $id_arr[] = $data->id; //更新分类统计 // $c2 = new Category('id', $data->cid); // $c2->count--; // $c2->save(); $tablename = Record::tableFromClass('Category'); $sql = "UPDATE {$tablename} SET count=count-1 WHERE id = '{$data->cid}'"; Record::$__CONN__->query($sql); } } //sql Article::moveIds($id_arr, $newcid); } //更新文章分类统计 $c1 = new Category('id', $newcid); $c1->count = $c1->count + count($id_arr); $c1->save(); del_cache(); go_redirect('index.php?job=admin_article'); }