diff --git a/system/controllers/accounts.php b/system/controllers/accounts.php index d68e0623..52c0dba6 100644 --- a/system/controllers/accounts.php +++ b/system/controllers/accounts.php @@ -96,7 +96,7 @@ switch ($action) { } if (empty($msg)) { - if (!empty($_FILES['photo']['name'])) { + if (!empty($_FILES['photo']['name']) && file_exists($_FILES['photo']['tmp_name'])) { if (function_exists('imagecreatetruecolor')) { $hash = md5_file($_FILES['photo']['tmp_name']); $subfolder = substr($hash, 0, 2); @@ -129,11 +129,11 @@ switch ($action) { } } if (file_exists($imgPath)) { - if ($user['photo'] != '') { - if (file_exists($UPLOAD_PATH . $d['photo'])) { - unlink($UPLOAD_PATH . $d['photo']); - if (file_exists($UPLOAD_PATH . $d['photo'] . '.thumb.jpg')) { - unlink($UPLOAD_PATH . $d['photo'] . '.thumb.jpg'); + if ($user['photo'] != '' && strpos($user['photo'], 'default') === false) { + if (file_exists($UPLOAD_PATH . $user['photo'])) { + unlink($UPLOAD_PATH . $user['photo']); + if (file_exists($UPLOAD_PATH . $user['photo'] . '.thumb.jpg')) { + unlink($UPLOAD_PATH . $user['photo'] . '.thumb.jpg'); } } } diff --git a/system/controllers/customers.php b/system/controllers/customers.php index cee428d9..81483e44 100644 --- a/system/controllers/customers.php +++ b/system/controllers/customers.php @@ -347,8 +347,8 @@ switch ($action) { ->find_many(); if ($d) { if(isset($routes['3']) && $routes['3'] == 'deletePhoto'){ - if($d['photo'] != '' && $d['photo'] != '/user.default.jpg'){ - if(file_exists($UPLOAD_PATH.$d['photo'])){ + if($d['photo'] != '' && strpos($d['photo'], 'default') === false){ + if(file_exists($UPLOAD_PATH.$d['photo']) && strpos($d['photo'], 'default') === false){ unlink($UPLOAD_PATH.$d['photo']); if(file_exists($UPLOAD_PATH.$d['photo'].'.thumb.jpg')){ unlink($UPLOAD_PATH.$d['photo'].'.thumb.jpg'); @@ -628,7 +628,7 @@ switch ($action) { } if ($msg == '') { - if (!empty($_FILES['photo']['name'])) { + if (!empty($_FILES['photo']['name']) && file_exists($_FILES['photo']['tmp_name'])) { if (function_exists('imagecreatetruecolor')) { $hash = md5_file($_FILES['photo']['tmp_name']); $subfolder = substr($hash, 0, 2); @@ -661,11 +661,11 @@ switch ($action) { } } if(file_exists($imgPath)){ - if($c['photo'] != ''){ - if(file_exists($UPLOAD_PATH.$d['photo'])){ - unlink($UPLOAD_PATH.$d['photo']); - if(file_exists($UPLOAD_PATH.$d['photo'].'.thumb.jpg')){ - unlink($UPLOAD_PATH.$d['photo'].'.thumb.jpg'); + if($c['photo'] != '' && strpos($c['photo'], 'default') === false){ + if(file_exists($UPLOAD_PATH.$c['photo'])){ + unlink($UPLOAD_PATH.$c['photo']); + if(file_exists($UPLOAD_PATH.$c['photo'].'.thumb.jpg')){ + unlink($UPLOAD_PATH.$c['photo'].'.thumb.jpg'); } } } diff --git a/system/controllers/settings.php b/system/controllers/settings.php index 8f3ca5a9..62445e06 100644 --- a/system/controllers/settings.php +++ b/system/controllers/settings.php @@ -475,8 +475,8 @@ switch ($action) { } if ($d) { if(isset($routes['3']) && $routes['3'] == 'deletePhoto'){ - if($d['photo'] != '' && $d['photo'] != '/admin.default.png'){ - if(file_exists($UPLOAD_PATH.$d['photo'])){ + if($d['photo'] != '' && strpos($d['photo'], 'default') === false){ + if(file_exists($UPLOAD_PATH.$d['photo']) && strpos($d['photo'], 'default') === false){ unlink($UPLOAD_PATH.$d['photo']); if(file_exists($UPLOAD_PATH.$d['photo'].'.thumb.jpg')){ unlink($UPLOAD_PATH.$d['photo'].'.thumb.jpg'); @@ -653,7 +653,7 @@ switch ($action) { } run_hook('edit_admin'); #HOOK if ($msg == '') { - if (!empty($_FILES['photo']['name'])) { + if (!empty($_FILES['photo']['name']) && file_exists($_FILES['photo']['tmp_name'])) { if (function_exists('imagecreatetruecolor')) { $hash = md5_file($_FILES['photo']['tmp_name']); $subfolder = substr($hash, 0, 2); @@ -686,7 +686,7 @@ switch ($action) { } } if(file_exists($imgPath)){ - if($d['photo'] != ''){ + if($d['photo'] != '' && strpos($d['photo'], 'default') === false){ if(file_exists($UPLOAD_PATH.$d['photo'])){ unlink($UPLOAD_PATH.$d['photo']); if(file_exists($UPLOAD_PATH.$d['photo'].'.thumb.jpg')){ diff --git a/system/lan/indonesia.json b/system/lan/indonesia.json index f8029c50..891a74be 100644 --- a/system/lan/indonesia.json +++ b/system/lan/indonesia.json @@ -810,5 +810,20 @@ "Package_Details": "Rincian Paket", "Summary": "Ringkasan", "Allow_Balance_custom_amount": "Izinkan Saldo jumlah khusus", - "Allow_Customer_buy_balance_with_any_amount": "Izinkan Pelanggan membeli saldo dengan jumlah berapa pun" + "Allow_Customer_buy_balance_with_any_amount": "Izinkan Pelanggan membeli saldo dengan jumlah berapa pun", + "Or": "Atau", + "Filter": "Menyaring", + "Show_chart": "Tampilkan grafik", + "Start_Date": "Tanggal Mulai", + "Start_time": "Waktu mulai", + "End_Date": "Tanggal Akhir", + "End_Time": "Akhir Zaman", + "Internet_Plans": "Paket Internet", + "Methods": "Metode", + "Hap_Lite": "Hap Lite", + "balance": "keseimbangan", + "radius": "radius", + "Max_30_days": "Maksimal 30 hari", + "Information": "Informasi", + "Export_and_Print_will_show_all_data_without_pagination": "Ekspor dan Cetak akan menampilkan semua data tanpa pagination" } \ No newline at end of file diff --git a/system/uploads/admin.default.png b/system/uploads/admin.default.png new file mode 100644 index 00000000..3bc948ce Binary files /dev/null and b/system/uploads/admin.default.png differ diff --git a/system/vendor/yosiazwan/php-facedetection/FaceDetector.php b/system/vendor/yosiazwan/php-facedetection/FaceDetector.php index 57ea021f..6455b464 100644 --- a/system/vendor/yosiazwan/php-facedetection/FaceDetector.php +++ b/system/vendor/yosiazwan/php-facedetection/FaceDetector.php @@ -180,12 +180,12 @@ class FaceDetector * * @throws NoFaceException */ - public function cropFaceToJpeg($outFileName = null, $resize = false, $width = 200) + public function cropFaceToJpeg($outFileName = null, $width = 200) { if (empty($this->face)) { throw new NoFaceException('No face detected'); } - if (!$resize) { + // if (!$resize) { $x = ($a = $this->face['x'] - $this->face['w'] / 2) > 0 ? $a : 0; $y = ($b = $this->face['y'] - $this->face['w'] / 2) > 0 ? $b : 0; $im_width = imagesx($this->canvas); @@ -193,24 +193,24 @@ class FaceDetector $w = ($w = $this->face['w'] * 2) > $im_width ? $im_width : $w; $h = ($h = $w) > $im_height ? $im_height : $h; - $canvas = imagecreatetruecolor($w, $h); + $canvas = imagecreatetruecolor($width, $width); imagecopy($canvas, $this->canvas, 0, 0, $x, $y, $w, $h); // $canvas = imagecreatetruecolor($this->face['w'], $this->face['w']); // imagecopy($canvas, $this->canvas, 0, 0, $this->face['x'], $this->face['y'], $this->face['w'], $this->face['w']); - } else { - $x = ($a = $this->face['x'] - $width / 2) > 0 ? $a : 0; - $y = ($b = $this->face['y'] - $width / 2) > 0 ? $b : 0; - $im_width = imagesx($this->canvas); - $im_height = imagesy($this->canvas); - $w = ($w = $width * 2) > $im_width ? $im_width : $w; - $h = ($h = $w) > $im_height ? $im_height : $h; + // } else { + // $x = ($a = $this->face['x'] - $width / 2) > 0 ? $a : 0; + // $y = ($b = $this->face['y'] - $width / 2) > 0 ? $b : 0; + // $im_width = imagesx($this->canvas); + // $im_height = imagesy($this->canvas); + // $w = ($w = $width * 2) > $im_width ? $im_width : $w; + // $h = ($h = $w) > $im_height ? $im_height : $h; - $canvas = imagecreatetruecolor($w, $h); - imagecopy($canvas, $this->canvas, 0, 0, $x, $y, $w, $h); + // $canvas = imagecreatetruecolor($w, $h); + // imagecopy($canvas, $this->canvas, 0, 0, $width, $width, $w, $h); - // $canvas = imagecreatetruecolor($width, $width); - // imagecopyresized($canvas, $this->canvas, 0, 0, $this->face['x'], $this->face['y'], $width, $width, $this->face['w'], $this->face['w']); - } + // // $canvas = imagecreatetruecolor($width, $width); + // // imagecopyresized($canvas, $this->canvas, 0, 0, $this->face['x'], $this->face['y'], $width, $width, $this->face['w'], $this->face['w']); + // } if ($outFileName === null) { header('Content-type: image/jpeg'); diff --git a/ui/ui/admin-edit.tpl b/ui/ui/admin-edit.tpl index 4aaad2e4..9e406d9f 100644 --- a/ui/ui/admin-edit.tpl +++ b/ui/ui/admin-edit.tpl @@ -21,7 +21,7 @@