Esempio n. 1
0
 private function urlInsertDB($bulkUrl)
 {
     $hash = $this->getUrlKey($bulkUrl);
     $sql = "INSERT INTO lu_urlcontainer(bulkUrl,shortUrl,hashUrl) VALUES(?,?,?)";
     $data = [$bulkUrl, $this->siteName . $hash, $hash];
     parent::affect_rows($sql, $data);
     $sqlResult = $this->checkUrlInDB($bulkUrl);
     return $sqlResult;
 }
Esempio n. 2
0
    <!-- CUSTOM SCRIPTS -->
    <script src="assets/js/custom.js"></script>
    <?php 
    if ($_SERVER['REQUEST_METHOD'] === 'POST') {
        require_once '../src/core/LightUrl.php';
        $user_id = $queryUserInfo[0]->id;
        $password = $queryUserInfo[0]->password;
        $username = $_POST['username'];
        $password_old = sha1(md5($_POST["old_password"]));
        $password_new = sha1(md5($_POST["new_password"]));
        $password_newTry = sha1(md5($_POST["new_passwordAgain"]));
        if ($password == $password_old) {
            if ($password_new == $password_newTry) {
                $sql = "UPDATE lu_users set username=?,password=? WHERE id=?";
                $data = [$username, $password_new, $user_id];
                LightDB::affect_rows($sql, $data);
                $_SESSION['username'] = $username;
                header("location:settings.php?rMsgCode=1");
            } else {
                header("location:settings.php?rMsgCode=2");
            }
        } else {
            header("location:settings.php?rMsgCode=3");
        }
    }
    ?>

    </body>
    </html>
<?php 
}