forked from opencart/opencart
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
blueyon
committed
May 3, 2009
1 parent
744f34b
commit c683546
Showing
3,007 changed files
with
14,342 additions
and
37,482 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
class ControllerCommonLogin extends Controller { | ||
private $error = array(); | ||
|
||
public function index() { | ||
$this->load->language('common/login'); | ||
|
||
$this->document->title = $this->language->get('heading_title'); | ||
|
||
if ($this->user->isLogged()) { | ||
$this->redirect($this->url->https('common/home')); | ||
} | ||
|
||
if (($this->request->post) && ($this->validate())) { | ||
$this->redirect($this->url->https('common/home')); | ||
} | ||
|
||
$this->data['title'] = $this->language->get('heading_title'); | ||
$this->data['base'] = (@$this->request->server['HTTPS'] != 'on') ? HTTP_SERVER : HTTPS_SERVER; | ||
$this->data['charset'] = $this->language->get('charset'); | ||
$this->data['direction'] = $this->language->get('direction'); | ||
$this->data['language'] = $this->language->get('code'); | ||
|
||
$this->data['text_login'] = $this->language->get('text_login'); | ||
|
||
$this->data['entry_username'] = $this->language->get('entry_username'); | ||
$this->data['entry_password'] = $this->language->get('entry_password'); | ||
|
||
$this->data['button_login'] = $this->language->get('button_login'); | ||
|
||
$this->data['error_warning'] = @$this->error['warning']; | ||
|
||
$this->data['action'] = $this->url->https('common/login'); | ||
|
||
$this->template = 'common/login.tpl'; | ||
$this->children = array('common/header'); | ||
$this->render(); | ||
} | ||
|
||
private function validate() { | ||
if (!$this->user->login(@$this->request->post['username'], @$this->request->post['password'])) { | ||
$this->error['warning'] = $this->language->get('error_login'); | ||
} | ||
|
||
if (!$this->error) { | ||
return TRUE; | ||
} else { | ||
return FALSE; | ||
} | ||
} | ||
|
||
public function checkLogin() { | ||
if (!$this->user->isLogged()) { | ||
return $this->forward('common/login'); | ||
} | ||
} | ||
} | ||
?> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?php | ||
class ControllerCommonMenu extends Controller { | ||
protected function index() { | ||
$this->load->language('common/menu'); | ||
|
||
$this->data['text_admin'] = $this->language->get('text_admin'); | ||
$this->data['text_backup'] = $this->language->get('text_backup'); | ||
$this->data['text_catalog'] = $this->language->get('text_catalog'); | ||
$this->data['text_category'] = $this->language->get('text_category'); | ||
$this->data['text_configuration'] = $this->language->get('text_configuration'); | ||
$this->data['text_country'] = $this->language->get('text_country'); | ||
$this->data['text_coupon'] = $this->language->get('text_coupon'); | ||
$this->data['text_currency'] = $this->language->get('text_currency'); | ||
$this->data['text_customer'] = $this->language->get('text_customer'); | ||
$this->data['text_customers'] = $this->language->get('text_customers'); | ||
$this->data['text_download'] = $this->language->get('text_download'); | ||
$this->data['text_extension'] = $this->language->get('text_extension'); | ||
$this->data['text_feed'] = $this->language->get('text_feed'); | ||
$this->data['text_geo_zone'] = $this->language->get('text_geo_zone'); | ||
$this->data['text_home'] = $this->language->get('text_home'); | ||
$this->data['text_help'] = $this->language->get('text_help'); | ||
$this->data['text_information'] = $this->language->get('text_information'); | ||
$this->data['text_language'] = $this->language->get('text_language'); | ||
$this->data['text_localisation'] = $this->language->get('text_localisation'); | ||
$this->data['text_logout'] = $this->language->get('text_logout'); | ||
$this->data['text_mail'] = $this->language->get('text_mail'); | ||
$this->data['text_manufacturer'] = $this->language->get('text_manufacturer'); | ||
$this->data['text_module'] = $this->language->get('text_module'); | ||
$this->data['text_order'] = $this->language->get('text_order'); | ||
$this->data['text_order_status'] = $this->language->get('text_order_status'); | ||
$this->data['text_payment'] = $this->language->get('text_payment'); | ||
$this->data['text_product'] = $this->language->get('text_product'); | ||
$this->data['text_reports'] = $this->language->get('text_reports'); | ||
$this->data['text_report_sale'] = $this->language->get('text_report_sale'); | ||
$this->data['text_report_viewed'] = $this->language->get('text_report_viewed'); | ||
$this->data['text_report_purchased'] = $this->language->get('text_report_purchased'); | ||
$this->data['text_review'] = $this->language->get('text_review'); | ||
$this->data['text_support'] = $this->language->get('text_support'); | ||
$this->data['text_shipping'] = $this->language->get('text_shipping'); | ||
$this->data['text_shop'] = $this->language->get('text_shop'); | ||
$this->data['text_setting'] = $this->language->get('text_setting'); | ||
$this->data['text_stock_status'] = $this->language->get('text_stock_status'); | ||
$this->data['text_tax_class'] = $this->language->get('text_tax_class'); | ||
$this->data['text_total'] = $this->language->get('text_total'); | ||
$this->data['text_user'] = $this->language->get('text_user'); | ||
$this->data['text_user_guide'] = $this->language->get('text_user_guide'); | ||
$this->data['text_users'] = $this->language->get('text_users'); | ||
$this->data['text_user_group'] = $this->language->get('text_user_group'); | ||
$this->data['text_weight_class'] = $this->language->get('text_weight_class'); | ||
$this->data['text_opencart'] = $this->language->get('text_opencart'); | ||
$this->data['text_zone'] = $this->language->get('text_zone'); | ||
|
||
$this->data['backup'] = $this->url->https('tool/backup'); | ||
$this->data['category'] = $this->url->https('catalog/category'); | ||
$this->data['country'] = $this->url->https('localisation/country'); | ||
$this->data['currency'] = $this->url->https('localisation/currency'); | ||
$this->data['coupon'] = $this->url->https('customer/coupon'); | ||
$this->data['customer'] = $this->url->https('customer/customer'); | ||
$this->data['download'] = $this->url->https('catalog/download'); | ||
$this->data['feed'] = $this->url->https('extension/feed'); | ||
$this->data['geo_zone'] = $this->url->https('localisation/geo_zone'); | ||
$this->data['home'] = $this->url->https('common/home'); | ||
$this->data['information'] = $this->url->https('catalog/information'); | ||
$this->data['language'] = $this->url->https('localisation/language'); | ||
$this->data['logout'] = $this->url->https('common/logout'); | ||
$this->data['mail'] = $this->url->https('customer/mail'); | ||
$this->data['manufacturer'] = $this->url->https('catalog/manufacturer'); | ||
$this->data['module'] = $this->url->https('extension/module'); | ||
$this->data['order'] = $this->url->https('customer/order'); | ||
$this->data['order_status'] = $this->url->https('localisation/order_status'); | ||
$this->data['payment'] = $this->url->https('extension/payment'); | ||
$this->data['product'] = $this->url->https('catalog/product'); | ||
$this->data['report_sale'] = $this->url->https('report/sale'); | ||
$this->data['report_viewed'] = $this->url->https('report/viewed'); | ||
$this->data['report_purchased'] = $this->url->https('report/purchased'); | ||
$this->data['review'] = $this->url->https('catalog/review'); | ||
$this->data['shipping'] = $this->url->https('extension/shipping'); | ||
$this->data['shop'] = HTTP_CATALOG; | ||
$this->data['setting'] = $this->url->https('setting/setting'); | ||
$this->data['stock_status'] = $this->url->https('localisation/stock_status'); | ||
$this->data['tax_class'] = $this->url->https('localisation/tax_class'); | ||
$this->data['total'] = $this->url->https('extension/total'); | ||
$this->data['user'] = $this->url->https('user/user'); | ||
$this->data['user_group'] = $this->url->https('user/user_group'); | ||
$this->data['weight_class'] = $this->url->https('localisation/weight_class'); | ||
$this->data['zone'] = $this->url->https('localisation/zone'); | ||
|
||
$this->id = 'menu'; | ||
$this->template = 'common/menu.tpl'; | ||
|
||
$this->render(); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
class ControllerCommonPermission extends Controller { | ||
public function checkPermission() { | ||
if (isset($this->request->get['route'])) { | ||
$route = $this->request->get['route']; | ||
|
||
$part = explode('/', $route); | ||
|
||
$ignore = array( | ||
'common/home', | ||
'common/login', | ||
'common/logout', | ||
'common/permission', | ||
'error/error_403', | ||
'error/error_404' | ||
); | ||
|
||
if (!in_array(@$part[0] . '/' . @$part[1], $ignore)) { | ||
if (!$this->user->hasPermission('access', @$part[0] . '/' . @$part[1])) { | ||
return $this->forward('error/permission'); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
?> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
<?php | ||
class ControllerCustomerMail extends Controller { | ||
private $error = array(); | ||
|
||
public function index() { | ||
$this->load->language('customer/mail'); | ||
|
||
$this->document->title = $this->language->get('heading_title'); | ||
|
||
$this->load->model('customer/customer'); | ||
|
||
if (($this->request->server['REQUEST_METHOD'] == 'POST') && ($this->validate())) { | ||
$emails = array(); | ||
|
||
switch ($this->request->post['to']) { | ||
case 'newsletter': | ||
$results = $this->model_customer_customer->getCustomersByNewsletter(); | ||
|
||
foreach ($results as $result) { | ||
$emails[] = $result['email']; | ||
} | ||
break; | ||
case 'customer': | ||
$results = $this->model_customer_customer->getCustomers(); | ||
|
||
foreach ($results as $result) { | ||
$emails[] = $result['email']; | ||
} | ||
break; | ||
default: | ||
$result = $this->model_customer_customer->getCustomer($this->request->post['to']); | ||
|
||
$emails[] = $result['email']; | ||
break; | ||
} | ||
|
||
if ($emails) { | ||
$message = '<html dir="ltr" lang="en">' . "\n"; | ||
$message .= '<head>' . "\n"; | ||
$message .= '<title>' . $this->request->post['subject'] . '</title>' . "\n"; | ||
$message .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' . "\n"; | ||
$message .= '</head>' . "\n"; | ||
$message .= '<body>' . htmlspecialchars_decode($this->request->post['message']) . '</body>' . "\n"; | ||
$message .= '</html>' . "\n"; | ||
|
||
foreach ($emails as $email) { | ||
$mail = new Mail(); | ||
$mail->setTo($email); | ||
$mail->setFrom($this->config->get('config_email')); | ||
$mail->setSender($this->config->get('config_store')); | ||
$mail->setSubject($this->request->post['subject']); | ||
$mail->setHtml($message); | ||
$mail->send(); | ||
} | ||
} | ||
|
||
$this->session->data['success'] = $this->language->get('text_success'); | ||
|
||
$this->redirect($this->url->https('customer/mail')); | ||
} | ||
|
||
$this->data['heading_title'] = $this->language->get('heading_title'); | ||
|
||
$this->data['text_newsletter'] = $this->language->get('text_newsletter'); | ||
$this->data['text_customer'] = $this->language->get('text_customer'); | ||
|
||
$this->data['entry_to'] = $this->language->get('entry_to'); | ||
$this->data['entry_subject'] = $this->language->get('entry_subject'); | ||
$this->data['entry_message'] = $this->language->get('entry_message'); | ||
|
||
$this->data['button_send'] = $this->language->get('button_send'); | ||
$this->data['button_cancel'] = $this->language->get('button_cancel'); | ||
|
||
$this->data['tab_general'] = $this->language->get('tab_general'); | ||
|
||
$this->data['error_warning'] = @$this->error['warning']; | ||
$this->data['error_to'] = @$this->error['to']; | ||
$this->data['error_subject'] = @$this->error['subject']; | ||
$this->data['error_message'] = @$this->error['message']; | ||
|
||
$this->document->breadcrumbs = array(); | ||
|
||
$this->document->breadcrumbs[] = array( | ||
'href' => $this->url->https('common/home'), | ||
'text' => $this->language->get('text_home'), | ||
'separator' => FALSE | ||
); | ||
|
||
$this->document->breadcrumbs[] = array( | ||
'href' => $this->url->https('customer/mail'), | ||
'text' => $this->language->get('heading_title'), | ||
'separator' => ' :: ' | ||
); | ||
|
||
$this->data['success'] = @$this->session->data['success']; | ||
|
||
unset($this->session->data['success']); | ||
|
||
$this->data['action'] = $this->url->https('customer/mail'); | ||
$this->data['cancel'] = $this->url->https('customer/mail'); | ||
|
||
$this->data['customers'] = array(); | ||
|
||
$results = $this->model_customer_customer->getCustomers(); | ||
|
||
foreach ($results as $result) { | ||
$this->data['customers'][] = array( | ||
'customer_id' => $result['customer_id'], | ||
'name' => $result['firstname'] . ' ' . $result['lastname'] . ' (' . $result['email'] . ')' | ||
); | ||
} | ||
|
||
$this->data['to'] = @$this->request->post['to']; | ||
$this->data['subject'] = @$this->request->post['subject']; | ||
$this->data['message'] = @$this->request->post['message']; | ||
|
||
$this->id = 'content'; | ||
$this->template = 'customer/mail.tpl'; | ||
$this->layout = 'common/layout'; | ||
|
||
$this->render(); | ||
} | ||
|
||
private function validate() { | ||
if (!$this->user->hasPermission('modify', 'customer/mail')) { | ||
$this->error['warning'] = $this->language->get('error_permission'); | ||
} | ||
|
||
if (!$this->request->post['subject']) { | ||
$this->error['subject'] = $this->language->get('error_subject'); | ||
} | ||
|
||
if (!$this->request->post['message']) { | ||
$this->error['message'] = $this->language->get('error_message'); | ||
} | ||
|
||
if (!$this->error) { | ||
return TRUE; | ||
} else { | ||
return FALSE; | ||
} | ||
} | ||
} | ||
?> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.