View file apps/native/api/delete_account/content.php

File size: 1.31Kb
<?php 
# @*************************************************************************@
# @ Software author: Mansur Altamirov (Mansur_TL)                           @
# @ Author_url 1: https://www.instagram.com/mansur_tl                       @
# @ Author_url 2: http://codecanyon.net/user/mansur_tl                      @
# @ Author E-mail: vayart.help@gmail.com                                    @
# @*************************************************************************@
# @ ColibriSM - The Ultimate Modern Social Media Sharing Platform           @
# @ Copyright (c) 2020 - 2021 ColibriSM. All rights reserved.               @
# @*************************************************************************@

if (empty($cl['is_logged'])) {
	$data         = array(
		'code'    => 401,
		'data'    => array(),
		'message' => 'Unauthorized Access'
	);
}
else {
	$acc_password = fetch_or_get($_POST['password'], false);

    if (empty($acc_password) || (password_verify($acc_password, $me['password']) != true)) {
        $data['code']    = 400;
        $data['message'] = "Account password is missing or invalid";
        $data['data']    = array();
    }

    else {
        $data["code"]    = 200;
        $data["message"] = "Account deleted successfully";
        $data["data"]    = array();

        cl_delete_user_data($me['id']);
    }
}