Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Use Debian 7 ("Wheezy"), a stable OS with reliable archives from the PHP 5.4 era
FROM debian:7

# --- Point to the official Debian archive ---
RUN echo "deb http://archive.debian.org/debian/ wheezy main" > /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian/ wheezy main" >> /etc/apt/sources.list

# Prevent interactive prompts during installation
ENV DEBIAN_FRONTEND=noninteractive

# Update package lists and install Apache, PHP5, and common extensions
# Note: --force-yes is needed to accept unsigned archive repositories
RUN apt-get -o Acquire::Check-Valid-Until=false update && \
apt-get install -y --force-yes \
apache2 \
libapache2-mod-php5 \
php5-mysql \
php5-gd \
php5-curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Configure Apache
RUN a2enmod php5
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2

# Set the working directory to the web root
WORKDIR /var/www

# Expose port 80 to the host machine
EXPOSE 80

# Command to start the Apache server in the foreground
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
8 changes: 4 additions & 4 deletions application/config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@

$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => '',
'hostname' => 'db',
'username' => 'root',
'password' => 'root',
'database' => 'encode_anggota',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
Expand Down
4 changes: 3 additions & 1 deletion application/controllers/admin/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ public function complete($page = 1)
//for pagination
$count_complete = $this->Anggota_Model->get_total_complete();
$data['page_size'] = 10;
$start = 1 + ($page - 1)*$data['page_size'];
$start = ($page - 1)*$data['page_size'];

$data['data_complete'] = $this->Anggota_Model->get_complete($start);

$data['pages'] = $count_complete / $data['page_size'];
$data['page_length'] = 5;
$data['page_active'] = $page;
Expand Down
7 changes: 4 additions & 3 deletions application/models/Anggota_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ public function get_all()
*/
public function get_complete($start)
{

$this->db->where('nama_panggilan <>','-');
$this->db->where('tempat_lahir <>', '-');
$this->db->where('alamat_sekarang <>','-');
$this->db->where('angkatan_himpunan >','28');
$this->db->where('angkatan_himpunan >=','28');
$this->db->limit(10,$start);
$query = $this->db->get('anggota');
return $query->result();
Expand Down Expand Up @@ -279,7 +280,7 @@ public function is_password_changed($id)
$query = $this->db->where('id_anggota', $id)->get('anggota');
$result = $query->result();
$result = reset($result);
return ($result->password != "$2y$10$4yHnBHYoaBV1KLPXf8K2b.3F4Lzz8XRs5BcG...VCKVLYvCtBR/zG");
return ($result->password != '$2a$12$LPCRQCNNO0y07ITLBAB6peo68nvUvAKcGbNAlBiknhlaQTSRrHtem');
}


Expand Down Expand Up @@ -309,7 +310,7 @@ public function get_count_anggota_angkatan()

public function reset_password($id)
{
$pass_default = "$2y$10$4yHnBHYoaBV1KLPXf8K2b.3F4Lzz8XRs5BcG...VCKVLYvCtBR/zG";
$pass_default = '$2a$12$LPCRQCNNO0y07ITLBAB6peo68nvUvAKcGbNAlBiknhlaQTSRrHtem';
$data = array (
"password" => $pass_default
);
Expand Down
2 changes: 1 addition & 1 deletion application/models/Identity.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Identity extends CI_Model {
public function login($username, $password)
{
if ($username == "admin"){
if (!password_verify($password,"$2y$10$1IjkPES8.GIPoKh5hWz1vOEWZRAyZ840zj11kfqnPviYeDqbsM9P.")){
if (!password_verify($password,"$2a$12$4YqKQccfBvq77.R.YLVhAOZPPrw3ZS04oZjz6.0PQL3koMl.htfb6")){
$this->session->set_flashdata('error', 'username / password salah');
return FALSE;
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
},
"require-dev": {
"mikey179/vfsStream": "1.1.*"

}
}
20 changes: 20 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: '3.8'

services:
xampp:
image: tomsik68/xampp:5
container_name: my_legacy_xampp
ports:
- "8080:80" # Access web server on http://localhost:8080
# - "41061:22" # Port for SSH, you probably don't need this
volumes:
- .:/www
db:
image: mysql:8.0
container_name: old-database-anggota-himpunan
restart: unless-stopped
# ... inside your db service ...
command:
- --default-authentication-plugin=mysql_native_password
- --character-set-server=utf8
- --collation-server=utf8_general_ci
environment:
MYSQL_DATABASE: mysqldb
MYSQL_USER: base
MYSQL_PASSWORD: root
MYSQL_ROOT_PASSWORD: root
volumes:
# Persists database data on the host machine
- db_data:/var/lib/mysql
ports:
# Exposes MySQL port to the host for external tools (e.g., DBeaver)
- "3306:3306"

volumes:
db_data:
4 changes: 4 additions & 0 deletions readme.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@




###################
What is CodeIgniter
###################
Expand Down
1,093 changes: 1,093 additions & 0 deletions sql/db_yang_jalan.sql

Large diffs are not rendered by default.

Loading