예제 #1
0
 public function actionAddFavourite()
 {
     if (isset($_POST['idUserList']) && (isset($_POST['idTruth']) || isset($_POST['idDare']))) {
         //Verify that the person that add to favourite is the owner of the list
         $model = UserList::model()->findByPk($_POST['idUserList']);
         if ($model->idUser == Yii::app()->user->getId()) {
             $model = new Userlistcontent();
             $model->idUserList = $_POST['idUserList'];
             if (isset($_POST['idTruth'])) {
                 $model->idTruth = $_POST['idTruth'];
             }
             if (isset($_POST['idDare'])) {
                 $model->idDare = $_POST['idDare'];
             }
             if ($model->save()) {
                 echo "SUCCESS";
                 $ttotot = "rr";
                 $ttotot = "rr";
             }
         }
     }
 }
예제 #2
0
 public function actionDeleteUserListContent()
 {
     if (isset($_POST['idUserListContent'])) {
         $userListContent = Userlistcontent::model()->with('userList')->findByPk($_POST['idUserListContent']);
         //Verify that the person who deletes the content is its owner
         if ($userListContent->userList->idUser == Yii::app()->user->getId()) {
             if ($userListContent->delete()) {
                 echo "SUCCESS";
                 return;
             }
         }
     }
     echo "ERROR";
     return;
 }
예제 #3
0
<?php

if (isset($_POST['idUserList']) && (isset($_POST['idTruth']) || isset($_POST['idDare']))) {
    //VERIFIER QUE PERSONNE QUI AJOUTE EST BIEN PERSONNE QUI POSSEDE LA LISTE
    $test = 'toto';
    $test = 'toto';
    $test = 'toto';
    $model = new Userlistcontent();
    $model->idUserList = $_POST['idUserList'];
    if (isset($_POST['idTruth'])) {
        $model->idTruth = $_POST['idTruth'];
    }
    if (isset($_POST['idDare'])) {
        $model->idTruth = $_POST['idDare'];
    }
    if ($model->save()) {
        echo "SUCCESS";
    } else {
        echo "FAIL";
    }
}