본문 바로가기
728x90
반응형

Framework (Backend)38

(Lavavel) 비밀번호 단방향암호화(SHA256) 하기 : Laravel 8.x, MySQL 정보통신망법, 개인정보보호법 등에 의하면 비밀번호는 단방향암호화(SHA256 등), 개인정보는 양방향암호화(AES256 등)를 하도록 되어 있습니다. 지금까지 작성한 예제는 이런 법에 맞지 않아서 서비스할 수 없겠네요. 여기에서는 비밀번호의 단방향 암호화를 구현해보도록 하겠습니다. SHA256을 적용하겠습니다. PHP(Laravel)에서는 아무런 작업을 하지 않고, DB(MySQL)에서만 작업을 하겠습니다. 1. 일단 DBMS에 접속해봅니다.$ mysql -u xyz -pxyz123 xyzmysql: [Warning] Using a password on the command line interface can be insecure.Reading table information for completion o.. 2021. 8. 29.
(Lavavel) 관리자 삭제하기 : Laravel 8.x 1. 관리자 삭제를 위한 저장 프로시저(deleteAdmin)을 만들어봅시다.$ mysql -u xyz -pxyz123 xyzmysql: [Warning] Using a password on the command line interface can be insecure.Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -AWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 271Server version: 8.0.26-0ubuntu0... 2021. 8. 29.
(Lavavel) 관리자 수정하기 : Laravel 8.x 1. xyz/resources/views/mgmt/admin/update_form.blade.php 을 작성한다. × 관리자 수정 @csrf 아이디 userid }}"/> sno }}" /> 별명 (필수) nick }}"/>  2. xyz/app/Http/Controllers/Mgmt/Admin.php 에 다음을 추가한다.... // 관리자 수정 폼 // /mgnt/admin/update_form/{id} public function update_form ($id) { // $t_admin = DB::select('CALL getAdmin(?)', [$.. 2021. 8. 29.
(Lavavel) 관리자 비밀번호 변경하기 : Laravel 8.x 1. 저장 프로시저 (getAdmin) 생성$ mysql -u xyz -pxyz123 xyzmysql: [Warning] Using a password on the command line interface can be insecure.Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -AWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 21Server version: 8.0.26-0ubuntu0.20.04.2 (Ubuntu)Copy.. 2021. 8. 28.
(Lavavel) 관리자 추가하기 : Laravel 8.x 1. 저장 프로시저 (insertAdmin) 생성$ mysql -u xyz -pxyz123 xyzmysql: [Warning] Using a password on the command line interface can be insecure.Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -AWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 21Server version: 8.0.26-0ubuntu0.20.04.2 (Ubuntu)C.. 2021. 8. 24.
(Lavavel) 관리자 목록 보여주기 : Laravel 8.x 1. 관련 모듈 설치$ sudo apt-get install php-mysql 2. DB연결 설정$ sudo vi ~/project/xyz/.env...DB_CONNECTION=mysqlDB_HOST=127.0.0.1DB_PORT=3306DB_DATABASE=xyzDB_USERNAME=xyzDB_PASSWORD=xyz123... 3. 저장 프로시저 (listAdmins) 생성$ mysql -u xyz -pxyz123 xyzmysql: [Warning] Using a password on the command line interface can be insecure.Reading table information for completion of table and column namesYou can turn o.. 2021. 8. 23.
728x90
반응형