public function actionDeleteUserList() { if (isset($_POST['idUserList'])) { $userList = Userlist::model()->findByPk($_POST['idUserList']); //Verify that the person who deletes the content is its owner if ($userList->idUser == Yii::app()->user->getId()) { if ($userList->delete()) { echo "SUCCESS"; return; } } } echo "ERROR"; return; }
<?php if (isset($_POST["action"]) and $_POST["action"] == "register") { $db = new SQL(0); $j = true; if (Userlist::userexists($_POST["username"])) { PageEngine::AddErrorMessage("register", "Der Username wird bereits verwendet"); $j = false; } if ($j) { $passwort = ""; $alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"; while (strlen($passwort) < 6) { $passwort .= substr($alpha, rand(0, strlen($alpha)), 1); } $w = array(); $w["username"] = $_POST["username"]; $w["email_standard"] = strtolower($_POST["email"]); $w["dt_registered"] = time(); $db->Create(0, "user_list", $w); $userid = $db->LastInsertKey(); $w2 = array(); $w2["username"] = "******" . $userid . "]"; $w2["pwd"] = md5($passwort); $w2["provider"] = "local"; $w2["user"] = $userid; $db->Create(0, "user_login", $w2); $mail = new PHPMailer(); $mail->SetFrom('no-reply@' . $_SERVER["HTTP_HOST"], 'Registrierung ' . SiteConfig::val("page/title")); $mail->AddAddress($_POST["email"], $w["username"]); $local = PageEngine::html_find("email_register", ".tpl");