Ejemplo n.º 1
0
 function post_xhr($action = null)
 {
     $users = new UsersData();
     if (is_null($action)) {
         echo json_encode(StatusReturn::E400('400 Missing Required Data!'), JSON_NUMERIC_CHECK);
     } else {
         if ($action == 'change-pass' && $users->checkPass() && !$users->authNeeded()) {
             if ($_POST['current'] != '' && $_POST['password'] != '' && $_POST['password'] == $_POST['password2'] && $users->checkPass(null, $_POST['current'])) {
                 $users->changePassword($_POST['password']);
                 echo json_encode(StatusReturn::S200('Password Changed!'), JSON_NUMERIC_CHECK);
             } else {
                 echo json_encode(StatusReturn::E400('400 Missing Required Data!'), JSON_NUMERIC_CHECK);
             }
         } else {
             echo json_encode(StatusReturn::E401('401 Not Authorized!'), JSON_NUMERIC_CHECK);
         }
     }
 }
Ejemplo n.º 2
0
 function post_xhr($page = null)
 {
     $users = new UsersData();
     if (is_null($page)) {
         echo json_encode(StatusReturn::E400('400 Missing Required Data!'), JSON_NUMERIC_CHECK);
     } else {
         if ($page != 'nav' && $users->checkPass() && !$users->authNeeded()) {
             PagesData::saveDescription('page-' . $page, $_POST['pk'], $_POST['value']);
             echo json_encode(StatusReturn::S200('Description Saved!'), JSON_NUMERIC_CHECK);
         } else {
             if ($users->checkPass() && !$users->authNeeded()) {
                 PagesData::saveDescription('autocms-' . $page, $_POST['pk'], $_POST['value']);
                 echo json_encode(StatusReturn::S200('Description Saved!'), JSON_NUMERIC_CHECK);
             } else {
                 echo json_encode(StatusReturn::E401('401 Not Authorized!'), JSON_NUMERIC_CHECK);
             }
         }
     }
 }