Exemplo n.º 1
0
     }
     break;
 case 'edit':
     $itemid or message();
     $do->itemid = $itemid;
     $r = $do->get_one();
     if (!$r || $r['username'] != $_username) {
         message();
     }
     if ($submit) {
         if ($do->pass($post)) {
             $post['username'] = $_username;
             $post['email'] = $_email;
             $need_check = $MOD['alert_check'] == 2 ? $MG['check'] : $MOD['alert_check'];
             $post['status'] = get_status($r['status'], $need_check);
             $do->edit($post);
             dmsg($L['op_edit_success'], $forward);
         } else {
             message($do->errmsg);
         }
     } else {
         extract($r);
     }
     break;
 case 'delete':
     $itemid or message();
     $do->itemid = $itemid;
     $r = $do->get_one();
     if (!$r || $r['username'] != $_username) {
         message();
     }