Permalink
Browse files

edit password OK

  • Loading branch information...
1 parent 36bd053 commit 1adef5964fd801a59e96e96e96fe89056de854c1 futura-creative committed Feb 26, 2013
Showing 1,074 changed files with 3,354 additions and 661 deletions.
View
0 .htaccess 100755 → 100644
No changes.
View
0 README.md 100755 → 100644
No changes.
View
0 app/.htaccess 100755 → 100644
No changes.
View
0 app/Config/Schema/db_acl.php 100755 → 100644
No changes.
View
0 app/Config/Schema/db_acl.sql 100755 → 100644
No changes.
View
0 app/Config/Schema/i18n.php 100755 → 100644
No changes.
View
0 app/Config/Schema/i18n.sql 100755 → 100644
No changes.
View
0 app/Config/Schema/sessions.php 100755 → 100644
No changes.
View
0 app/Config/Schema/sessions.sql 100755 → 100644
No changes.
View
0 app/Config/acl.ini.php 100755 → 100644
No changes.
View
0 app/Config/acl.php 100755 → 100644
No changes.
View
0 app/Config/bootstrap.php 100755 → 100644
No changes.
View
2 app/Config/core.php 100755 → 100644
@@ -94,7 +94,7 @@
*
* And uncomment the App.baseUrl below:
*/
- //Configure::write('App.baseUrl', env('SCRIPT_NAME'));
+ Configure::write('App.baseUrl', env('SCRIPT_NAME'));
/**
* Uncomment the define below to use CakePHP prefix routes.
View
0 app/Config/database.php 100755 → 100644
No changes.
View
0 app/Config/database.php.default 100755 → 100644
No changes.
View
10 app/Config/email.php 100755 → 100644
@@ -51,12 +51,12 @@ class EmailConfig {
public $smtp = array(
'transport' => 'Smtp',
- 'from' => array('site@localhost' => 'My Site'),
- 'host' => 'smtp.sendgrid.net',
- 'port' => 587,
+ 'from' => array('noreplay@i-addins.com' => 'Konfirmasi Pendaftaran'),
+ 'host' => 'yuki.qwords.net ',
+ 'port' => 465,
'timeout' => 30,
- 'username' => 'andy.wie88',
- 'password' => 'rital0v3u',
+ 'username' => 'noreply@i-addins.com',
+ 'password' => 'noreplay',
'client' => null,
'log' => false,
//'charset' => 'utf-8',
View
0 app/Config/email.php.default 100755 → 100644
No changes.
View
0 app/Config/routes.php 100755 → 100644
No changes.
View
0 app/Console/Command/AppShell.php 100755 → 100644
No changes.
View
0 app/Console/Command/Task/empty 100755 → 100644
No changes.
View
0 app/Console/Templates/empty 100755 → 100644
No changes.
View
0 app/Console/cake 100755 → 100644
No changes.
View
0 app/Console/cake.bat 100755 → 100644
No changes.
View
0 app/Console/cake.php 100755 → 100644
No changes.
View
0 app/Controller/AdsController.php 100755 → 100644
No changes.
View
0 app/Controller/AppController.php 100755 → 100644
No changes.
View
No changes.
View
0 app/Controller/Component/empty 100755 → 100644
No changes.
View
No changes.
View
No changes.
View
@@ -16,7 +16,7 @@ class UsersController extends AppController {
public function beforeFilter() {
parent::beforeFilter();
- $this->Auth->allow(array('register','validate_form'));
+ $this->Auth->allow(array('register','validate_form','activateAccount'));
}
public function change(){
@@ -80,6 +80,8 @@ public function edit(){
);
if($this->User->updateAll($data,array("User.id"=>$this->request->data['User']['id']))){
$message = array("status"=>1);
+ $user_data = $this->User->findById($this->Auth->user('id'));
+ $this->Auth->login($user_data['User']);
echo json_encode($message);
}
}
@@ -167,12 +169,12 @@ public function validate_form(){
}
}
- public function validate(){
+ public function activateAccount(){
/* Do The Validation */
$uid = $this->User->decrypt($this->request->query['uid'],'1234');
$this->User->updateAll(
array('User.status'=>1),
- array('User.id ='=>$uid)
+ array('User.id'=>$uid)
);
$this->redirect(array("controller"=>$this->name,"action"=>"login","?"=>array("active"=>True)));
}
View
0 app/Lib/empty 100755 → 100644
No changes.
View
0 app/Locale/eng/LC_MESSAGES/empty 100755 → 100644
No changes.
View
0 app/Model/Ad.php 100755 → 100644
No changes.
View
0 app/Model/AppModel.php 100755 → 100644
No changes.
View
0 app/Model/Behavior/empty 100755 → 100644
No changes.
View
0 app/Model/Category.php 100755 → 100644
No changes.
View
0 app/Model/City.php 100755 → 100644
No changes.
View
0 app/Model/Datasource/empty 100755 → 100644
No changes.
View
0 app/Model/State.php 100755 → 100644
No changes.
View
13 app/Model/User.php 100755 → 100644
@@ -143,7 +143,7 @@ public function konfirmPassword($check){
return False;
}
- function encrypt($id, $key)
+ public function encrypt($id, $key)
{
$id = base_convert($id, 10, 36); // Save some space
$data = mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $id, 'ecb');
@@ -152,7 +152,7 @@ function encrypt($id, $key)
return $data;
}
- function decrypt($encrypted_id, $key)
+ public function decrypt($encrypted_id, $key)
{
$data = pack('H*', $encrypted_id); // Translate back to binary
$data = mcrypt_decrypt(MCRYPT_BLOWFISH, $key, $data, 'ecb');
@@ -169,23 +169,22 @@ public function beforeSave($options = array()) {
}
public function afterSave($created) {
- /*
App::uses('CakeEmail', 'Network/Email');
App::uses('Security','Utility');
parent::afterSave($created);
if($created){
$uid = $this->find('first',
array(
- 'conditions' => array('User.email' => $this->data[$this->name]['username']), //array of conditions
+ 'conditions' => array('User.username' => $this->data[$this->name]['username']), //array of conditions
'fields' => array('User.id'), //array of field names
));
$email = new CakeEmail();
- $email->from(array('no-reply@talefeast-zenotech.rhcloud.com' => 'ADDins'));
+ $email->from(array('noreply@i-addins.com' => 'noreply@i-addins.com'));
$email->to($this->data[$this->name]['username']);
$email->subject('Registration');
- $isi = "http://andywie88.byethost12.com/validate?uid=".$this->encrypt($uid['User']['id'],'1234');
+ $isi = "http://www.i-addins.com/users/activateAccount?uid=".$this->encrypt($uid['User']['id'],'1234');
$email->send($isi);
- }*/
+ }
}
}
View
0 app/Plugin/empty 100755 → 100644
No changes.
View
No changes.
View
No changes.
View
0 app/Test/Case/View/Helper/empty 100755 → 100644
No changes.
View
0 app/Test/Fixture/empty 100755 → 100644
No changes.
View
@@ -0,0 +1,191 @@
+<?php
+
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+ * Description of User
+ *
+ * @author futura-creative
+ */
+class User extends AppModel {
+ var $name = "User";
+ var $useTable = "users";
+ //put your code here
+
+ var $belongsTo = array(
+ 'State' => array(
+ 'className' => 'State',
+ 'foreignKey' => 'state'
+ ),
+ 'City'=> array(
+ 'className' => 'City',
+ 'foreignKey' => 'city'
+ )
+ );
+
+ var $hasMany = array(
+ 'Ad' => array(
+ 'className' => 'Ad',
+ 'foreignKey' => 'user_id'
+ )
+ );
+
+ var $validate = array(
+ 'first_name' => array(
+ 'notEmpty' => array(
+ 'rule' => 'notEmpty',
+ 'message' => 'Nama depan tidak boleh kosong'
+ )
+ ),
+ 'last_name' => array(
+ 'notEmpty' => array(
+ 'rule' => 'notEmpty',
+ 'message' => 'Nama belakang tidak boleh kosong'
+ )
+ ),
+ 'username' => array(
+ 'notEmpty' => array(
+ 'rule' => 'notEmpty',
+ 'message' => 'Email tidak boleh kosong'
+ ),
+ 'must_unique' => array(
+ 'rule' => 'isUnique',
+ 'message' => 'Email yang sama sudah ada'
+ ),
+ 'must_email' => array(
+ 'rule' => 'email',
+ 'message' => 'Masukan Email yang valid'
+ )
+ ),
+ 'password' => array(
+ 'notEmpty' => array(
+ 'rule' => 'notEmpty',
+ 'message' => 'Password tidak boleh kosong'
+ ),
+ 'must-content-both' => array(
+ 'rule' => '/^([0-9]+[a-zA-Z]+|[a-zA-Z]+[0-9]+)[0-9a-zA-Z]*$/i',
+ 'message' => 'Password harus mengandung setidaknya 1 angka dan 1 huruf'
+ )
+ ),
+ 'konfirmasi_password' => array(
+ 'notEmpty' => array(
+ 'rule' => 'notEmpty',
+ 'message' => 'Konfirmasi Password tidak boleh kosong'
+ ),
+ 'same_password' => array(
+ 'rule' => 'konfirmPassword',
+ 'message' => 'Password dengan Konfirmasi Password harus sama'
+ )
+ ),
+ 'jenis_kelamin' => array(
+ 'notEmpty' => array(
+ 'rule' => 'notEmpty',
+ 'message' => 'Jenis kelamin tidak boleh kosong'
+ )
+ ),
+ 'alamat' => array(
+ 'notEmpty' => array(
+ 'rule' => 'notEmpty',
+ 'message' => 'Alamat tidak boleh kosong'
+ )
+ ),
+ 'state' => array(
+ 'notEmpty' => array(
+ 'rule' => array('comparison','!=',0),
+ 'message' => 'Pilih salah satu pronvisi'
+ )
+ ),
+ 'city' => array(
+ 'notEmpty' => array(
+ 'rule'=> array('comparison','!=',0),
+ 'message' => 'Pilih salah satu kota'
+ )
+ ),
+ 'handphone' => array(
+ 'notEmpty' => array(
+ 'rule' => 'notEmpty',
+ 'message' => 'No. Handphone tidak boleh kosong'
+ ),
+ 'numerik' => array(
+ 'rule' => 'numeric',
+ 'message' => 'No. Handphone hanya mengandung nomor'
+ )
+ ),
+ 'security_question' => array(
+ 'notEmpty' => array(
+ 'rule' => 'notEmpty',
+ 'message' => 'Pertanyaan Keamanan tidak boleh kosong'
+ )
+ ),
+ 'security_answer' => array(
+ 'notEmpty' => array(
+ 'rule' => 'notEmpty',
+ 'message' => 'Jawaban Keamanan tidak boleh kosong'
+ )
+ ),
+ 'old_password' => array(
+ 'notEmpty' => array(
+ 'rule' => 'notEmpty',
+ 'message' => 'Password Lama tidak boleh kosong'
+ )
+ )
+ );
+
+ public function konfirmPassword($check){
+ $password = $this->data[$this->name]['password'];
+ $konfirm_password = $this->data[$this->name]['konfirmasi_password'];
+ if($password == $konfirm_password){
+ return True;
+ }
+ return False;
+ }
+
+ public function encrypt($id, $key)
+ {
+ $id = base_convert($id, 10, 36); // Save some space
+ $data = mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $id, 'ecb');
+ $data = bin2hex($data);
+
+ return $data;
+ }
+
+ public function decrypt($encrypted_id, $key)
+ {
+ $data = pack('H*', $encrypted_id); // Translate back to binary
+ $data = mcrypt_decrypt(MCRYPT_BLOWFISH, $key, $data, 'ecb');
+ $data = base_convert($data, 36, 10);
+
+ return $data;
+ }
+
+ public function beforeSave($options = array()) {
+ parent::beforeSave($options);
+ App::uses('Security','Utility');
+ $this->data[$this->name]['password'] = AuthComponent::password($this->data[$this->name]['password']);
+ return true;
+ }
+
+ public function afterSave($created) {
+ App::uses('CakeEmail', 'Network/Email');
+ App::uses('Security','Utility');
+ parent::afterSave($created);
+ if($created){
+ $uid = $this->find('first',
+ array(
+ 'conditions' => array('User.username' => $this->data[$this->name]['username']), //array of conditions
+ 'fields' => array('User.id'), //array of field names
+ ));
+ $email = new CakeEmail();
+ $email->from(array('noreply@i-addins.com' => 'noreply@i-addins.com'));
+ $email->to($this->data[$this->name]['username']);
+ $email->subject('Registration');
+ $isi = "http://www.i-addins.com/users/activateAccount?uid=".$this->encrypt($uid['User']['id'],'1234');
+ $email->send($isi);
+ }
+ }
+}
+
+?>
View
0 app/Vendor/empty 100755 → 100644
No changes.
View
0 app/View/Ads/index.ctp 100755 → 100644
No changes.
@@ -0,0 +1,15 @@
+<?php foreach($ads as $ad):?>
+ <div class="Ads-box box-shadow">
+ <div class="new-label"></div>
+ <div class="Ads-image">
+ <?= $this->Html->image('../files/'.$ad['Ad']['image'],array('class'=>'Ads-image')) ?>
+ </div>
+ <div class="Ads-content">
+ <h2><?= $ad['Ad']['ads_title'] ?></h2>
+ <p><?= $ad['Ad']['ads_body'] ?></p>
+ </div>
+ <div class="Ads-contact">
+ <strong>C : <?= $ad['User']['first_name']." ".$ad['User']['last_name'] ?> <br/> +62<?= $ad['User']['handphone'] ?> </strong>
+ </div>
+ </div>
+<?php endforeach; ?>
View
@@ -0,0 +1,15 @@
+<?php foreach($ads as $ad):?>
+ <div class="Ads-box box-shadow">
+ <div class="new-label"></div>
+ <div class="Ads-image">
+ <?= $this->Html->image('../files/'.$ad['Ad']['image'],array('class'=>'Ads-image')) ?>
+ </div>
+ <div class="Ads-content">
+ <h2><?= $ad['Ad']['ads_title'] ?></h2>
+ <p><?= $ad['Ad']['ads_body'] ?></p>
+ </div>
+ <div class="Ads-contact">
+ <strong>C : <?= $ad['User']['first_name']." ".$ad['User']['last_name'] ?> <br/> +62<?= $ad['User']['handphone'] ?> </strong>
+ </div>
+ </div>
+<?php endforeach; ?>
View
0 app/View/Elements/empty 100755 → 100644
No changes.
View
0 app/View/Emails/html/default.ctp 100755 → 100644
No changes.
View
0 app/View/Emails/text/default.ctp 100755 → 100644
No changes.
View
0 app/View/Errors/error400.ctp 100755 → 100644
No changes.
View
0 app/View/Errors/error500.ctp 100755 → 100644
No changes.
View
0 app/View/Helper/AppHelper.php 100755 → 100644
No changes.
View
No changes.
View
No changes.
View
0 app/View/Layouts/ajax.ctp 100755 → 100644
No changes.
View
6 app/View/Layouts/default.ctp 100755 → 100644
@@ -111,11 +111,7 @@ $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework
<div id="footer-content">
<ul>
<li>Copyright &copy; 2013 Futura Creative Inc.</li>
- <li>Contact Us</li>
- </ul>
- <ul class="icons">
- <li><?= $this->Html->image('fb-icon.png') ?></li>
- <li><?= $this->Html->image('tw-icon.png') ?></li>
+ <li><a href="mailto:cs@i-addins.com">Contact Us</a></li>
</ul>
</div>
</div>
View
0 app/View/Layouts/error.ctp 100755 → 100644
No changes.
View
0 app/View/Layouts/flash.ctp 100755 → 100644
No changes.
View
0 app/View/Layouts/js/default.ctp 100755 → 100644
No changes.
View
0 app/View/Layouts/rss/default.ctp 100755 → 100644
No changes.
Oops, something went wrong.

0 comments on commit 1adef59

Please sign in to comment.