From 232aa1924c8c0f10d87b210b46c9f061af5c844c Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 17 Oct 2010 13:29:57 +0000 Subject: added files --- .../Application/Controllers/BaseController.php | 171 ++++++ .../Application/Controllers/ContactController.php | 41 ++ .../Application/Controllers/CreditsController.php | 41 ++ .../Application/Controllers/DownloadController.php | 199 +++++++ .../Application/Controllers/GenericController.php | 658 +++++++++++++++++++++ .../Application/Controllers/HardwareController.php | 41 ++ .../Application/Controllers/HelpController.php | 40 ++ .../Application/Controllers/HistoryController.php | 185 ++++++ .../Application/Controllers/HomeController.php | 58 ++ .../Application/Controllers/ImageController.php | 39 ++ .../Application/Controllers/IssuesController.php | 171 ++++++ h-source/Application/Controllers/MyController.php | 209 +++++++ .../Application/Controllers/NewsController.php | 65 ++ .../Controllers/NotebooksController.php | 162 +++++ .../Application/Controllers/PrintersController.php | 158 +++++ .../Application/Controllers/ProjectController.php | 38 ++ .../Application/Controllers/ScannersController.php | 158 +++++ .../Application/Controllers/SearchController.php | 90 +++ .../Application/Controllers/UsersController.php | 428 ++++++++++++++ .../Controllers/VideocardsController.php | 152 +++++ .../Application/Controllers/WifiController.php | 154 +++++ h-source/Application/Hooks/AfterInitialization.php | 10 + h-source/Application/Hooks/BeforeChecks.php | 16 + .../Application/Hooks/BeforeInitialization.php | 10 + h-source/Application/Hooks/index.html | 1 + h-source/Application/Include/distributions.php | 86 +++ h-source/Application/Include/hardware.php | 216 +++++++ h-source/Application/Include/languages.php | 322 ++++++++++ h-source/Application/Include/myFunctions.php | 330 +++++++++++ h-source/Application/Include/params.php | 143 +++++ h-source/Application/Models/BaseModel.php | 66 +++ h-source/Application/Models/BoxesModel.php | 40 ++ h-source/Application/Models/DeletionModel.php | 51 ++ h-source/Application/Models/HardwareModel.php | 198 +++++++ h-source/Application/Models/HistoryModel.php | 48 ++ h-source/Application/Models/IssuesModel.php | 131 ++++ h-source/Application/Models/MessagesModel.php | 56 ++ h-source/Application/Models/NewsModel.php | 42 ++ h-source/Application/Models/NotebooksModel.php | 69 +++ h-source/Application/Models/ParamsModel.php | 41 ++ h-source/Application/Models/PrintersModel.php | 68 +++ h-source/Application/Models/ProfileModel.php | 70 +++ h-source/Application/Models/RevisionsModel.php | 48 ++ h-source/Application/Models/ScannersModel.php | 68 +++ h-source/Application/Models/TalkModel.php | 52 ++ h-source/Application/Models/UsersModel.php | 221 +++++++ h-source/Application/Models/VideocardsModel.php | 64 ++ h-source/Application/Models/WifiModel.php | 67 +++ h-source/Application/Modules/ModBase.php | 41 ++ h-source/Application/Modules/ModImage.php | 45 ++ h-source/Application/Modules/ModLink.php | 18 + h-source/Application/Modules/ModLinkimage.php | 18 + h-source/Application/Modules/ModRaw.php | 18 + h-source/Application/Modules/index.html | 1 + .../Application/Strings/Lang/It/DbCondStrings.php | 17 + .../Application/Strings/Lang/It/ModelStrings.php | 19 + .../Application/Strings/Lang/It/UploadStrings.php | 26 + .../Application/Strings/Lang/It/ValCondStrings.php | 69 +++ h-source/Application/Strings/Lang/It/index.html | 1 + h-source/Application/Strings/Lang/index.html | 1 + h-source/Application/Strings/index.html | 1 + h-source/Application/Views/Contact/index.php | 29 + h-source/Application/Views/Contact/index_es.php | 29 + h-source/Application/Views/Contact/index_it.php | 29 + h-source/Application/Views/Credits/index.php | 63 ++ h-source/Application/Views/Credits/index_es.php | 63 ++ h-source/Application/Views/Credits/index_it.php | 64 ++ h-source/Application/Views/Download/index.php | 68 +++ h-source/Application/Views/Download/index_es.php | 68 +++ h-source/Application/Views/Download/index_it.php | 68 +++ h-source/Application/Views/Download/xml.php | 20 + h-source/Application/Views/Hardware/left.php | 47 ++ h-source/Application/Views/Help/index.php | 361 +++++++++++ h-source/Application/Views/Help/index_es.php | 361 +++++++++++ h-source/Application/Views/Help/index_fr.php | 352 +++++++++++ h-source/Application/Views/Help/index_it.php | 378 ++++++++++++ h-source/Application/Views/History/viewall.php | 38 ++ h-source/Application/Views/Home/left.php | 34 ++ h-source/Application/Views/Home/left_es.php | 31 + h-source/Application/Views/Home/left_fr.php | 30 + h-source/Application/Views/Home/left_it.php | 30 + h-source/Application/Views/Issues/view.php | 202 +++++++ h-source/Application/Views/Issues/viewall.php | 118 ++++ h-source/Application/Views/My/email.php | 31 + h-source/Application/Views/My/goodbye.php | 61 ++ h-source/Application/Views/My/panel.php | 35 ++ h-source/Application/Views/My/password.php | 31 + h-source/Application/Views/My/profile.php | 31 + h-source/Application/Views/News/index.php | 49 ++ h-source/Application/Views/Notebooks/catalogue.php | 80 +++ h-source/Application/Views/Notebooks/form.php | 114 ++++ h-source/Application/Views/Notebooks/page.php | 92 +++ h-source/Application/Views/Printers/catalogue.php | 80 +++ h-source/Application/Views/Printers/form.php | 104 ++++ h-source/Application/Views/Printers/page.php | 92 +++ h-source/Application/Views/Project/index.php | 29 + h-source/Application/Views/Project/index_es.php | 29 + h-source/Application/Views/Project/index_it.php | 29 + h-source/Application/Views/Scanners/catalogue.php | 80 +++ h-source/Application/Views/Scanners/form.php | 104 ++++ h-source/Application/Views/Scanners/page.php | 92 +++ h-source/Application/Views/Search/form.php | 72 +++ h-source/Application/Views/Search/form_es.php | 72 +++ h-source/Application/Views/Search/form_it.php | 72 +++ h-source/Application/Views/Search/results.php | 66 +++ h-source/Application/Views/Users/add.php | 70 +++ h-source/Application/Views/Users/change.php | 28 + h-source/Application/Views/Users/confirmation.php | 42 ++ h-source/Application/Views/Users/contributions.php | 50 ++ h-source/Application/Views/Users/forgot.php | 55 ++ h-source/Application/Views/Users/login.php | 57 ++ h-source/Application/Views/Users/logout.php | 25 + h-source/Application/Views/Users/meet.php | 89 +++ h-source/Application/Views/Users/notice.php | 94 +++ .../Application/Views/Videocards/catalogue.php | 79 +++ h-source/Application/Views/Videocards/form.php | 98 +++ h-source/Application/Views/Videocards/page.php | 87 +++ h-source/Application/Views/Wifi/catalogue.php | 80 +++ h-source/Application/Views/Wifi/form.php | 98 +++ h-source/Application/Views/Wifi/page.php | 87 +++ h-source/Application/Views/bottom_left.php | 27 + h-source/Application/Views/climb.php | 35 ++ h-source/Application/Views/dialog.php | 100 ++++ h-source/Application/Views/differences.php | 43 ++ h-source/Application/Views/footer.php | 38 ++ h-source/Application/Views/header.php | 78 +++ h-source/Application/Views/history.php | 53 ++ h-source/Application/Views/if_page_deleted.php | 49 ++ h-source/Application/Views/license_notice.php | 24 + h-source/Application/Views/moderator_dialog.php | 62 ++ h-source/Application/Views/right.php | 118 ++++ h-source/Application/Views/suggest_dialog.php | 41 ++ h-source/Application/Views/talk.php | 140 +++++ h-source/Application/Views/top_left.php | 142 +++++ h-source/Application/index.html | 1 + 135 files changed, 11985 insertions(+) create mode 100644 h-source/Application/Controllers/BaseController.php create mode 100644 h-source/Application/Controllers/ContactController.php create mode 100644 h-source/Application/Controllers/CreditsController.php create mode 100644 h-source/Application/Controllers/DownloadController.php create mode 100644 h-source/Application/Controllers/GenericController.php create mode 100644 h-source/Application/Controllers/HardwareController.php create mode 100644 h-source/Application/Controllers/HelpController.php create mode 100644 h-source/Application/Controllers/HistoryController.php create mode 100644 h-source/Application/Controllers/HomeController.php create mode 100644 h-source/Application/Controllers/ImageController.php create mode 100644 h-source/Application/Controllers/IssuesController.php create mode 100644 h-source/Application/Controllers/MyController.php create mode 100644 h-source/Application/Controllers/NewsController.php create mode 100644 h-source/Application/Controllers/NotebooksController.php create mode 100644 h-source/Application/Controllers/PrintersController.php create mode 100644 h-source/Application/Controllers/ProjectController.php create mode 100644 h-source/Application/Controllers/ScannersController.php create mode 100644 h-source/Application/Controllers/SearchController.php create mode 100644 h-source/Application/Controllers/UsersController.php create mode 100644 h-source/Application/Controllers/VideocardsController.php create mode 100644 h-source/Application/Controllers/WifiController.php create mode 100644 h-source/Application/Hooks/AfterInitialization.php create mode 100644 h-source/Application/Hooks/BeforeChecks.php create mode 100644 h-source/Application/Hooks/BeforeInitialization.php create mode 100644 h-source/Application/Hooks/index.html create mode 100644 h-source/Application/Include/distributions.php create mode 100644 h-source/Application/Include/hardware.php create mode 100644 h-source/Application/Include/languages.php create mode 100644 h-source/Application/Include/myFunctions.php create mode 100644 h-source/Application/Include/params.php create mode 100644 h-source/Application/Models/BaseModel.php create mode 100644 h-source/Application/Models/BoxesModel.php create mode 100644 h-source/Application/Models/DeletionModel.php create mode 100644 h-source/Application/Models/HardwareModel.php create mode 100644 h-source/Application/Models/HistoryModel.php create mode 100644 h-source/Application/Models/IssuesModel.php create mode 100644 h-source/Application/Models/MessagesModel.php create mode 100644 h-source/Application/Models/NewsModel.php create mode 100644 h-source/Application/Models/NotebooksModel.php create mode 100644 h-source/Application/Models/ParamsModel.php create mode 100644 h-source/Application/Models/PrintersModel.php create mode 100644 h-source/Application/Models/ProfileModel.php create mode 100644 h-source/Application/Models/RevisionsModel.php create mode 100644 h-source/Application/Models/ScannersModel.php create mode 100644 h-source/Application/Models/TalkModel.php create mode 100755 h-source/Application/Models/UsersModel.php create mode 100644 h-source/Application/Models/VideocardsModel.php create mode 100644 h-source/Application/Models/WifiModel.php create mode 100644 h-source/Application/Modules/ModBase.php create mode 100644 h-source/Application/Modules/ModImage.php create mode 100644 h-source/Application/Modules/ModLink.php create mode 100644 h-source/Application/Modules/ModLinkimage.php create mode 100644 h-source/Application/Modules/ModRaw.php create mode 100644 h-source/Application/Modules/index.html create mode 100644 h-source/Application/Strings/Lang/It/DbCondStrings.php create mode 100644 h-source/Application/Strings/Lang/It/ModelStrings.php create mode 100644 h-source/Application/Strings/Lang/It/UploadStrings.php create mode 100644 h-source/Application/Strings/Lang/It/ValCondStrings.php create mode 100644 h-source/Application/Strings/Lang/It/index.html create mode 100644 h-source/Application/Strings/Lang/index.html create mode 100644 h-source/Application/Strings/index.html create mode 100644 h-source/Application/Views/Contact/index.php create mode 100644 h-source/Application/Views/Contact/index_es.php create mode 100644 h-source/Application/Views/Contact/index_it.php create mode 100644 h-source/Application/Views/Credits/index.php create mode 100644 h-source/Application/Views/Credits/index_es.php create mode 100644 h-source/Application/Views/Credits/index_it.php create mode 100644 h-source/Application/Views/Download/index.php create mode 100644 h-source/Application/Views/Download/index_es.php create mode 100644 h-source/Application/Views/Download/index_it.php create mode 100644 h-source/Application/Views/Download/xml.php create mode 100644 h-source/Application/Views/Hardware/left.php create mode 100644 h-source/Application/Views/Help/index.php create mode 100644 h-source/Application/Views/Help/index_es.php create mode 100644 h-source/Application/Views/Help/index_fr.php create mode 100644 h-source/Application/Views/Help/index_it.php create mode 100644 h-source/Application/Views/History/viewall.php create mode 100644 h-source/Application/Views/Home/left.php create mode 100644 h-source/Application/Views/Home/left_es.php create mode 100644 h-source/Application/Views/Home/left_fr.php create mode 100644 h-source/Application/Views/Home/left_it.php create mode 100644 h-source/Application/Views/Issues/view.php create mode 100644 h-source/Application/Views/Issues/viewall.php create mode 100644 h-source/Application/Views/My/email.php create mode 100644 h-source/Application/Views/My/goodbye.php create mode 100644 h-source/Application/Views/My/panel.php create mode 100644 h-source/Application/Views/My/password.php create mode 100644 h-source/Application/Views/My/profile.php create mode 100644 h-source/Application/Views/News/index.php create mode 100644 h-source/Application/Views/Notebooks/catalogue.php create mode 100644 h-source/Application/Views/Notebooks/form.php create mode 100644 h-source/Application/Views/Notebooks/page.php create mode 100644 h-source/Application/Views/Printers/catalogue.php create mode 100644 h-source/Application/Views/Printers/form.php create mode 100644 h-source/Application/Views/Printers/page.php create mode 100644 h-source/Application/Views/Project/index.php create mode 100644 h-source/Application/Views/Project/index_es.php create mode 100644 h-source/Application/Views/Project/index_it.php create mode 100644 h-source/Application/Views/Scanners/catalogue.php create mode 100644 h-source/Application/Views/Scanners/form.php create mode 100644 h-source/Application/Views/Scanners/page.php create mode 100644 h-source/Application/Views/Search/form.php create mode 100644 h-source/Application/Views/Search/form_es.php create mode 100644 h-source/Application/Views/Search/form_it.php create mode 100644 h-source/Application/Views/Search/results.php create mode 100755 h-source/Application/Views/Users/add.php create mode 100644 h-source/Application/Views/Users/change.php create mode 100644 h-source/Application/Views/Users/confirmation.php create mode 100644 h-source/Application/Views/Users/contributions.php create mode 100644 h-source/Application/Views/Users/forgot.php create mode 100755 h-source/Application/Views/Users/login.php create mode 100755 h-source/Application/Views/Users/logout.php create mode 100644 h-source/Application/Views/Users/meet.php create mode 100644 h-source/Application/Views/Users/notice.php create mode 100644 h-source/Application/Views/Videocards/catalogue.php create mode 100644 h-source/Application/Views/Videocards/form.php create mode 100644 h-source/Application/Views/Videocards/page.php create mode 100644 h-source/Application/Views/Wifi/catalogue.php create mode 100644 h-source/Application/Views/Wifi/form.php create mode 100644 h-source/Application/Views/Wifi/page.php create mode 100644 h-source/Application/Views/bottom_left.php create mode 100644 h-source/Application/Views/climb.php create mode 100644 h-source/Application/Views/dialog.php create mode 100644 h-source/Application/Views/differences.php create mode 100644 h-source/Application/Views/footer.php create mode 100644 h-source/Application/Views/header.php create mode 100644 h-source/Application/Views/history.php create mode 100644 h-source/Application/Views/if_page_deleted.php create mode 100644 h-source/Application/Views/license_notice.php create mode 100644 h-source/Application/Views/moderator_dialog.php create mode 100644 h-source/Application/Views/right.php create mode 100644 h-source/Application/Views/suggest_dialog.php create mode 100644 h-source/Application/Views/talk.php create mode 100644 h-source/Application/Views/top_left.php create mode 100644 h-source/Application/index.html (limited to 'h-source/Application') diff --git a/h-source/Application/Controllers/BaseController.php b/h-source/Application/Controllers/BaseController.php new file mode 100644 index 0000000..b201165 --- /dev/null +++ b/h-source/Application/Controllers/BaseController.php @@ -0,0 +1,171 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class BaseController extends Controller +{ + + protected $lang; + protected $ismoderator; + protected $querySanitized = true; + + protected $_topMenuClasses = array( + "home" => null, + "hardware" => null, + "credits" => null, + "issues" => null, + "contact" => null, + "search" => null, + "news" => null, + "download" => null, + "help" => null, + ); + + public function __construct($model, $controller, $queryString) { + parent::__construct($model, $controller, $queryString); + + header("Cache-Control: no-cache"); + + $this->model('BoxesModel'); + + $this->load('header'); + $this->load('footer','last'); + + $this->session('registered'); + $this->s['registered']->checkStatus(); + + $data['username'] = null; + $data['islogged'] = 'no'; + $data['token'] = 'token'; + $data['ismoderator'] = false; + $this->ismoderator = false; + + if ($this->s['registered']->status['status'] === 'logged') + { + $data['username'] = $this->s['registered']->status['user']; + $data['islogged'] = 'yes'; + $data['token'] = $this->s['registered']->status['token']; + $data['ismoderator'] = in_array('moderator',$this->s['registered']->status['groups']) ? true : false; + $this->ismoderator = $data['ismoderator']; + } + + $data['lang'] = 'en'; + $this->lang = 'en'; + + if (isset($this->_queryString[0])) + { + $lang = (strcmp($this->_queryString[0],'') !== 0) ? $this->_queryString[0] : 'en'; + $data['lang'] = Lang::sanitize($lang); + $this->lang = $data['lang']; + Lang::$current = $data['lang']; + } + + $data['tm'] = $this->_topMenuClasses; + +// print_r($this->_queryString); + $this->_queryString = $this->sanitizeQueryString($this->_queryString); + + $this->append($data); + + } + + protected function right($lang = 'en') + { + $hard = new HardwareModel(); + + $data['stat'] = $hard->clear()->select('type,count(*) AS numb')->where(array('-deleted'=>'no'))->groupBy('type')->toList('type','aggregate.numb')->send(); + + $logged = $this->s['registered']->getUsersLogged(); + + $data['numbLogged'] = count($logged); + + // get the right column container + $this->m['BoxesModel']->setWhereQueryClause(array('title'=>'right_bottom')); + $boxes = $this->m['BoxesModel']->getAll('boxes'); + + if (count($boxes) > 0) + { + $xml = htmlspecialchars_decode($boxes[0]['boxes']['message'],ENT_QUOTES); + + $box_news = new BoxParser($xml); + $data['htmlRightBox'] = $box_news->render(); + } + else + { + $data['htmlRightBox'] = null; + } + + $data['language_links'] = $this->buildLanguageLinks($this->lang); + +// print_r($this->_queryString); + + $this->append($data); + $this->load('right'); + } + + protected function sanitizeQueryString($queryArray) + { + $resArray = array(); + foreach ($queryArray as $item) + { + if (preg_match('/^[a-zA-Z0-9\-\_\.\+\s]+$/',$item)) + { + $resArray[] = sanitizeAll($item); + } + else + { + $this->querySanitized = false; + return array('en'); + } + } + return $resArray; + } + + protected function buildLanguageLinks($lang) + { + $status = $this->_queryString; + $cPage = $this->querySanitized ? $this->currPage : $this->baseUrl."/home/index"; + $link = "\n"; + return $link; + } + + protected function cleverLoad($file) + { + $fileInt = $file."_".$this->lang; + if (file_exists(ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS . ucwords($this->controller) . DS . $fileInt . '.php')) + { + $this->load($fileInt); + } + else + { + $this->load($file); + } + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/ContactController.php b/h-source/Application/Controllers/ContactController.php new file mode 100644 index 0000000..f1fe89e --- /dev/null +++ b/h-source/Application/Controllers/ContactController.php @@ -0,0 +1,41 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class ContactController extends BaseController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['contact'] = " class='currentitem'"; + + parent::__construct($model, $controller, $queryString); + + $data['title'] = 'contact - '.Website::$generalName; + $this->append($data); + } + + public function index($lang = 'en') + { + $this->cleverLoad('index'); + $this->right(); + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/CreditsController.php b/h-source/Application/Controllers/CreditsController.php new file mode 100644 index 0000000..ba19624 --- /dev/null +++ b/h-source/Application/Controllers/CreditsController.php @@ -0,0 +1,41 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class CreditsController extends BaseController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['credits'] = " class='currentitem'"; + + parent::__construct($model, $controller, $queryString); + + $data['title'] = 'credits - '.Website::$generalName; + $this->append($data); + } + + public function index($lang = 'en') + { + $this->cleverLoad('index'); + $this->right(); + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/DownloadController.php b/h-source/Application/Controllers/DownloadController.php new file mode 100644 index 0000000..4952456 --- /dev/null +++ b/h-source/Application/Controllers/DownloadController.php @@ -0,0 +1,199 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class DownloadController extends BaseController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['download'] = " class='currentitem'"; + + parent::__construct($model, $controller, $queryString); + + $this->model('HardwareModel'); + + $data['title'] = 'download - '.Website::$generalName; + $this->append($data); + } + + public function index($lang = 'en') + { + $this->cleverLoad('index'); + $this->right($lang); + } + + //get the xml of the archive + private function getXml($res) + { + $xml = null; + $xml = "\n"; + $xml .= "\n"; + $xml .= "\t\n"; + $xml .= "\t\th-node project\n"; + $xml .= "\t\twww.h-node.com\n"; + $xml .= "\t\t".date("Y-m-d h:m:s")."\n"; + $xml .= "\t\tThe contents of this page are in the Public Domain (see the CC0 page at http://creativecommons.org/publicdomain/zero/1.0/ for detailed information). Anyone is free to copy, modify, publish, use, sell, or distribute the text for any purpose, commercial or non-commercial, and by any means.\n"; + $xml .= "\t\n"; + + foreach ($res as $row) + { + $type = $row['hardware']['type']; + $xml .= "\t\n"; + + $xml .= "\t\t".$row['hardware']['id_hard']."\n"; + $xml .= "\t\t".$row['hardware']['type']."\n"; + + if ($type === 'notebook') + { + $xml .= "\t\t".$row['hardware']['subtype']."\n"; + } + + $xml .= "\t\t".$row['hardware']['model']."\n"; + + if ($type !== 'notebook') + { + $xml .= "\t\t".$row['hardware']['pci_id']."\n"; + } + + $xml .= "\t\t".$row['hardware']['vendor']."\n"; + $xml .= "\t\t".$row['hardware']['kernel']."\n"; + $xml .= "\t\t".$row['hardware']['distribution']."\n"; + $xml .= "\t\t".$row['hardware']['comm_year']."\n"; + if ($type !== 'notebook') + { + $xml .= "\t\t".$row['hardware']['interface']."\n"; + } + + if ($type === 'notebook' or $type === 'printer' or $type === 'scanner') + { + $xml .= "\t\t".$row['hardware']['compatibility']."\n"; + } + + if ($type === 'notebook') + { + $xml .= "\t\t".$row['hardware']['wifi_type']."\n"; + $xml .= "\t\t".$row['hardware']['video_card_type']."\n"; + } + + if ($type === 'notebook' or $type === 'wifi') + { + $xml .= "\t\t".$row['hardware']['wifi_works']."\n"; + } + + if ($type === 'notebook' or $type === 'videocard') + { + $xml .= "\t\t".$row['hardware']['video_card_works']."\n"; + } + if ($type === 'printer' or $type === 'scanner') + { + $xml .= "\t\t".$row['hardware']['driver']."\n"; + } + $xml .= "\t\t\n"; + + $xml .= "\t\t".$this->baseUrl."/".MyStrings::$reverse[$type]."/view/".$this->lang."/".$row['hardware']['id_hard']."/".encodeUrl($row['hardware']['model'])."\n"; + $xml .= "\t\t".$this->baseUrl."/".MyStrings::$reverse[$type]."/history/".$this->lang."/".$row['hardware']['id_hard']."\n"; + + $xml .= "\t\n"; + } + + $xml .= "\n"; + + return $xml; + } + + public function all($lang = 'en') + { + header ("Content-Type:text/xml"); + + $res = $this->m['HardwareModel']->clear()->select()->where(array('-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); + + $data['xml'] = $this->getXml($res); + + $this->append($data); + $this->clean(); + $this->load('xml'); + } + + public function notebooks($lang = 'en') + { + header ("Content-Type:text/xml"); + + $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'notebook','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); + + $data['xml'] = $this->getXml($res); + + $this->append($data); + $this->clean(); + $this->load('xml'); + } + + public function wifi($lang = 'en') + { + header ("Content-Type:text/xml"); + + $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'wifi','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); + + $data['xml'] = $this->getXml($res); + + $this->append($data); + $this->clean(); + $this->load('xml'); + } + + public function videocards($lang = 'en') + { + header ("Content-Type:text/xml"); + + $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'videocard','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); + + $data['xml'] = $this->getXml($res); + + $this->append($data); + $this->clean(); + $this->load('xml'); + } + + public function printers($lang = 'en') + { + header ("Content-Type:text/xml"); + + $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'printer','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); + + $data['xml'] = $this->getXml($res); + + $this->append($data); + $this->clean(); + $this->load('xml'); + } + + public function scanners($lang = 'en') + { + header ("Content-Type:text/xml"); + + $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'scanner','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); + + $data['xml'] = $this->getXml($res); + + $this->append($data); + $this->clean(); + $this->load('xml'); + } +} \ No newline at end of file diff --git a/h-source/Application/Controllers/GenericController.php b/h-source/Application/Controllers/GenericController.php new file mode 100644 index 0000000..a08956e --- /dev/null +++ b/h-source/Application/Controllers/GenericController.php @@ -0,0 +1,658 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class GenericController extends BaseController +{ + + protected $_controllerName = null; //as in the URL + + public $orderPopup; + + public function __construct($model, $controller, $queryString) { + parent::__construct($model, $controller, $queryString); + + $popup = new Popup(); + $popup->name = gtext('sort by'); + switch ($this->controller) + { + case 'wifi': + $popup->itemsName = array('last inserted','alphabetically','alphabetically desc'); + $popup->itemsValue = array('last-inserted','alphabetically','alphabetically-desc'); + break; + case 'videocards': + $popup->itemsName = array('last inserted','alphabetically','alphabetically desc'); + $popup->itemsValue = array('last-inserted','alphabetically','alphabetically-desc'); + break; + default: + $popup->itemsName = array('last inserted','alphabetically','alphabetically desc','compatibility'); + $popup->itemsValue = array('last-inserted','alphabetically','alphabetically-desc','compatibility'); + break; + } + + $this->orderPopup = $popup; + + } + + protected function insert($lang = 'en', $token = '') + { + $this->shift(2); + + $clean['token'] = sanitizeAlphanum($token); + + $data['notice'] = null; + $data['tree'] = $this->getSpecHardLink() . " » " . " insert"; + + $this->s['registered']->checkStatus(); + + if ($this->s['registered']->status['status'] === 'logged') + { + if (!$this->s['registered']->checkCsrf($clean['token'])) $this->redirect($this->controller.'/catalogue/'.$this->lang,2,'wrong token..'); + + if (isset($_POST['insertAction'])) + { + if ($this->checkDist()) + { + $pci_id = $this->request->post('pci_id','','sanitizeAll'); + if (strcmp($pci_id,'') !== 0) + { + $this->m['HardwareModel']->databaseConditions['insert']['+checkUnique'] = 'pci_id|VendorID:ProductID is already present in the database. This means that the device you are trying to insert is already in the database'; + } + + //insert the new device + $this->m['HardwareModel']->updateTable('insert'); + + if ($this->m['HardwareModel']->queryResult) + { + if (strcmp($this->controller,'notebooks') === 0) + { + session_start(); + $_SESSION['notebook_inserted'] = 'yes'; + } + } + + $this->viewRedirect($this->m['HardwareModel']->lastId); + } + } + + $data['notice'] = $this->m['HardwareModel']->notice; + + $data['submitName'] = "insertAction"; + $data['hiddenInput'] = null; + + $data['values'] = $this->m['HardwareModel']->getFormValues('insert','sanitizeHtml'); + $this->append($data); + + $this->load('top_left'); + $this->load('license_notice'); + $this->load('form'); + $this->load('bottom_left'); + $this->right(); + } + else + { + $this->redirect('users/login/'.$this->lang.'/'.$this->controller.'/catalogue',0); + } + } + + public function del($lang = 'en', $token = '') + { + header('Content-type: text/html; charset=UTF-8'); + + $this->shift(2); + + $this->clean(); + + $clean['token'] = sanitizeAlphanum($token); + + if ($this->s['registered']->status['status'] === 'logged') + { + if (!$this->s['registered']->checkCsrf($clean['token'])) die("wrong token"); + + $clean['id_user'] = (int)$this->s['registered']->status['id_user']; + $clean['id_hard'] = $this->request->post('id_hard',0,'forceInt'); + + $this->model("DeletionModel"); + + $numb = $this->m['DeletionModel']->where(array("id_hard"=>$clean['id_hard'],"created_by"=>$clean['id_user']))->rowNumber(); + + if ($numb === 0) + { + $id_dup = $this->request->post('id_duplicate',0,'forceInt'); + $object = $this->request->post('object','','sanitizeAll'); + + if ($id_dup === 0 and strcmp($object,'duplication') === 0) + { + echo "you have no specified the device duplicated by this model"; + } + else + { + $this->m['DeletionModel']->setFields('id_hard:forceInt,object,message,id_duplicate:forceInt','sanitizeAll'); + $this->m['DeletionModel']->values['created_by'] = $clean['id_user']; + + $this->m['DeletionModel']->updateTable('insert'); + if ($this->m['DeletionModel']->queryResult) + { + $hard = new HardwareModel(); + $c = $hard->where(array('id_hard'=>$clean['id_hard'],'ask_for_del'=>'yes'))->rowNumber(); + if ($c < 1) + { + $hard->db->update('hardware','ask_for_del',array('yes'),'id_hard='.$clean['id_hard']); + } + echo "operation executed"; + } + else + { + echo "one error occurred, please try later"; + } + } + } + else + { + echo "you have already asked for the deletion of this device"; + } + } + } + + protected function update($lang = 'en', $token = '') + { + $this->shift(2); + + $clean['token'] = sanitizeAlphanum($token); + + $data['notice'] = null; + $this->s['registered']->checkStatus(); + + if (isset($_POST['id_hard'])) + { + //get the id + $clean['id_hard'] = isset($_POST['id_hard']) ? (int)$_POST['id_hard'] : 0; + + if ($this->s['registered']->status['status'] === 'logged') + { + if (!$this->s['registered']->checkCsrf($clean['token'])) $this->redirect($this->controller.'/catalogue/'.$this->lang,2,'wrong token..'); + + $deleted = $this->m['HardwareModel']->select("hardware.deleted")->where(array("id_hard"=>$clean['id_hard']))->limit(1)->toList('deleted')->send(); + + if (strcmp($deleted[0],'no') === 0) + { + $ne_name = $this->m['HardwareModel']->getTheModelName($clean['id_hard']); + $name = encodeUrl($ne_name); + $data['name'] = $name; + $data['ne_name'] = $ne_name; + $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($clean['id_hard'],$name) . " » edit"; + + if (isset($_POST['updateAction'])) + { + if ($this->checkDist()) + { + $pci_id = $this->request->post('pci_id','','sanitizeAll'); + if (strcmp($pci_id,'') !== 0) + { + $this->m['HardwareModel']->databaseConditions['update']['+checkUniqueCompl'] = 'pci_id|VendorID:ProductID is already present in the database. This means that the device you are trying to insert is already in the database'; + } + + //carry out the update database action + $this->m['HardwareModel']->updateTable('update'); + + $this->viewRedirect($this->m['HardwareModel']->lastId); + } + } + + $data['notice'] = $this->m['HardwareModel']->notice; + + $data['id_hard'] = $clean['id_hard']; + $data['submitName'] = "updateAction"; + // echo $this->m['HardwareModel']->fields; + $data['values'] = $this->m['HardwareModel']->getFormValues('update','sanitizeHtml'); + $data['hiddenInput'] = "\n"; + + $this->append($data); + + $this->load('top_left'); + $this->load('license_notice'); + $this->load('form'); + $this->load('bottom_left'); + $this->right(); + } + else + { + $this->redirect($this->controller.'/catalogue/'.$this->lang,2,'deleted..'); + } + } + else + { + $this->redirect('users/login/'.$this->lang.'/'.$this->controller.'/view/'.$clean['id_hard'],0); + } + } + else + { + $this->redirect($this->controller.'/catalogue/'.$this->lang); + } + } + + protected function checkDist() + { + if (array_key_exists('distribution',$_POST)) + { + if (strcmp($_POST['distribution'],"") !== 0) + { + if (Distributions::check($_POST['distribution'])) + { + return true; + } + else + { + $this->m['HardwareModel']->result = false; + $this->m['HardwareModel']->notice = "
Distribution not allowed..
\n"; + return false; + } + } + else + { + $this->m['HardwareModel']->result = false; + $this->m['HardwareModel']->notice = "
Distribution not defined..
\n"; + return false; + } + } + $this->m['HardwareModel']->result = false; + return false; + } + + protected function viewRedirect($id) + { + $clean['id'] = (int)$id; + + if ($this->m['HardwareModel']->queryResult) + { + $name = encodeUrl($this->m['HardwareModel']->getTheModelName($clean['id'])); + $this->redirect($this->controller.'/view/'.$this->lang.'/'.$clean['id'].'/'.$name.$this->viewStatus); + } + } + + //load the view files + protected function loadViewAll($viewName = null) + { + $this->load('top_left'); + $viewArray = explode(',',$viewName); + foreach ($viewArray as $viewFile) + { + $this->load($viewFile); + } + $this->load('bottom_left'); + $this->right(); + } + + protected function catalogue($lang = 'en') + { + $data['title'] = $this->controller.' - '.Website::$generalName; + + Params::$nullQueryValue = 'undef'; + + $data['tree'] = $this->controller; + + $this->mod->aWhere(array("deleted"=>"no")); + + $this->mod->popupBuild(); + $popup = $this->mod->popupArray; + $popup['sort-by'] = $this->orderPopup; + + $this->helper('Popup',$this->controller.'/catalogue/'.$this->lang,$popup,'inclusive','page'); + //create the HTML of the popup + $data['popup'] = $this->h['Popup']->render(); + + $this->mod->orderBy = getOrderByClause($this->viewArgs['sort-by']); + $recordNumber = $this->mod->rowNumber(); + + $data['recordNumber'] = $recordNumber; + + //load the Pages helper + $this->helper('Pages',$this->controller.'/catalogue/'.$this->lang,'page'); + $page = $this->viewArgs['page']; + //set the limit clause + $this->mod->limit = $this->h['Pages']->getLimit($page,$recordNumber,10); + + $data['table'] = $this->mod->getAll(); +// echo $this->mod->getQuery(); + + $data['pageList'] = $this->h['Pages']->render($page-3,7); + + $this->append($data); + + $this->loadViewAll('catalogue'); + } + + protected function view($lang = 'en', $id_hard = 0, $name = null) + { + $this->shift(3); + + //set the history_page to 1 in the viewStatus + $this->viewArgs['history_page'] = 1; + $this->buildStatus(); + + $clean['id_hard'] = (int)$id_hard; + $data['id_hard'] = $clean['id_hard']; + $data['ne_name'] = null; + $data['name'] = null; + $data['tree'] = null; + $data['isDeleted'] = 'no'; + + if ($this->mod->checkType($clean['id_hard'])) + { + $this->mod->setWhereQueryClause(array("id_hard" => $clean['id_hard'])); + $data['table'] = $this->mod->getAll(); + + if (count($data['table']) > 0) + { + + $data['talk_number'] = $this->m['TalkModel']->select('count(*) as numb,id_hard')->where(array('id_hard'=>$clean['id_hard']))->rowNumber(); + + $data['ne_name'] = $data['table'][0]['hardware']['model']; + $data['name'] = encodeUrl($data['ne_name']); + $data['title'] = $data['ne_name'].' - '.Website::$generalName; + $data['tree'] = $this->getSpecHardLink() . " » ".$data['ne_name'].""; + $data['isDeleted'] = $data['table'][0]['hardware']['deleted']; + + if (strcmp($data['isDeleted'],'yes') === 0) + { + $deletion = new DeletionModel(); + $data['deletion'] = $deletion->select()->where(array('id_hard'=>$clean['id_hard']))->send(); + $data['deletionUsers'] = $deletion->getList($data['deletion'],'created_by'); + } + } + + $this->append($data); + + session_start(); + if ( isset($_SESSION['notebook_inserted']) and strcmp($this->controller,'notebooks') === 0 ) + { + $viewFilesList = 'suggest_dialog,dialog,page,if_page_deleted'; + unset($_SESSION['notebook_inserted']); + } + else + { + $viewFilesList = 'dialog,page,if_page_deleted'; + } + + $this->loadViewAll($viewFilesList); + } + else + { +// $this->redirect($this->_controller.'/'.); + } + } + + protected function history($lang = 'en', $id = 0) + { + $this->shift(2); + $clean['id'] = (int)$id; + $data['id'] = $clean['id']; + $data['ne_name'] = $this->m['HardwareModel']->getTheModelName($clean['id']); + $data['name'] = encodeUrl($data['ne_name']); + $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($clean['id'],$data['name'])." » history"; + + $data['title'] = 'history - '.Website::$generalName; + + //get the first revision + $res = $this->m['RevisionsModel']->db->select('revisions','id_rev','id_hard='.$clean['id'],null,'id_rev',1); + if (count($res) > 0) + { + $data['firstRev'] = $res[0]['revisions']['id_rev']; + } + + $res1 = $this->m['HardwareModel']->db->select('hardware','update_date,updated_by','id_hard='.$clean['id']); + + $this->m['RevisionsModel']->setWhereQueryClause(array('id_hard' => $clean['id'])); + + //load the Pages helper + $this->helper('Pages',$this->controller.'/history/'.$this->lang.'/'.$clean['id'],'history_page'); + //get the number of records + $recordNumber = $this->m['RevisionsModel']->rowNumber(); + $page = $this->viewArgs['history_page']; + //set the limit clause + $this->m['RevisionsModel']->limit = $this->h['Pages']->getLimit($page,$recordNumber,20); + $res2 = $this->m['RevisionsModel']->getFields('update_date,updated_by,id_rev'); + + $data['pageList'] = $this->h['Pages']->render($page-3,7); + + + $data['rev1'] = $res1; + $data['rev2'] = $res2; + + $this->append($data); + $this->loadViewAll('history'); + } + + protected function revision($lang = 'en', $id_rev = 0) + { + $this->shift(2); + $clean['id_rev'] = (int)$id_rev; + + $this->m['RevisionsModel']->setWhereQueryClause(array("id_rev" => $clean['id_rev'])); + $data['table'] = $this->m['RevisionsModel']->getAll(); + + $data['id_hard'] = 0; + $data['updated_by'] = null; + $data['update_date'] = null; + $data['name'] = null; + $data['ne_name'] = null; + $data['tree'] = null; + $data['isDeleted'] = 'no'; + + if (count($data['table']) > 0) + { + $data['id_hard'] = (int)$data['table'][0]['revisions']['id_hard']; + $data['ne_name'] = $this->m['HardwareModel']->getTheModelName($data['id_hard']); + $data['name'] = encodeUrl($data['ne_name']); + $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($data['id_hard'],$data['name'])." » " . $this->getHistoryLink($data['id_hard']) . " » revision"; + + $data['title'] = 'revision - '.Website::$generalName; + + $data['updated_by'] = $data['table'][0]['revisions']['updated_by']; + $data['update_date'] = $data['table'][0]['revisions']['update_date']; + } + + $this->append($data); + $this->loadViewAll('page'); + } + + protected function differences($lang = 'en', $id_hard = 0, $id_rev = 0) + { + $this->shift(3); + + $data['title'] = 'differences - '.Website::$generalName; + + $clean['id_hard'] = (int)$id_hard; + $clean['id_rev'] = (int)$id_rev; + + $data['id_hard'] = $clean['id_hard']; + $data['name'] = encodeUrl($this->m['HardwareModel']->getTheModelName((int)$data['id_hard'])); + $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($data['id_hard'],$data['name'])." » " . $this->getHistoryLink($clean['id_hard']) . " » differences"; + + $data['showDiff'] = false; + + $diffArray = array(); + + if (strcmp($clean['id_hard'],0) !== 0 and strcmp($clean['id_rev'],0) !== 0) + { + $this->m['RevisionsModel']->setWhereQueryClause(array('id_hard' => $clean['id_hard'],'id_rev' => '<='.$clean['id_rev'])); + $this->m['RevisionsModel']->limit = 2; + $res = $this->m['RevisionsModel']->getAll(); + if (count($res) > 1) + { + $newArray = $res[0]['revisions']; + $oldArray = $res[1]['revisions']; + + $data['update_new'] = $newArray['update_date']; + $data['update_old'] = $oldArray['update_date']; + $data['updated_by'] = $newArray['updated_by']; + + $diffArray = $this->mod->getDiffArray($oldArray, $newArray); + + $data['showDiff'] = true; + } + } + else if (strcmp($clean['id_hard'],0) !== 0 and strcmp($clean['id_rev'],0) === 0) + { + $this->mod->setWhereQueryClause(array('id_hard' => $clean['id_hard'])); + $lastRes = $this->mod->getAll(); + + if (count($lastRes) > 0) + { + $this->m['RevisionsModel']->setWhereQueryClause(array('id_hard' => $clean['id_hard'])); + $this->m['RevisionsModel']->limit = 1; + $revRes = $this->m['RevisionsModel']->getAll(); + + if (count($revRes) > 0) + { + $newArray = $lastRes[0]['hardware']; + $oldArray = $revRes[0]['revisions']; + + $data['update_new'] = $newArray['update_date']; + $data['update_old'] = $oldArray['update_date']; + $data['updated_by'] = $newArray['updated_by']; + + $diffArray = $this->mod->getDiffArray($oldArray, $newArray); + + $data['showDiff'] = true; + } + } + + } + + $data['fieldsWithBreaks'] = $this->mod->fieldsWithBreaks; + $data['diffArray'] = $diffArray; + + $this->append($data); + $this->loadViewAll('differences'); + } + + protected function climb($lang = 'en', $id_rev = 0, $token = '') + { + $this->shift(3); + + $data['title'] = 'make current - '.Website::$generalName; + + $clean['token'] = sanitizeAlphanum($token); + + $clean['id_rev'] = (int)$id_rev; + $clean['id_hard'] = (int)$this->m['RevisionsModel']->getIdHard($clean['id_rev']); + + if ($clean['id_hard'] !== 0) + { + $deleted = $this->m['HardwareModel']->select("hardware.deleted")->where(array("id_hard"=>$clean['id_hard']))->limit(1)->toList('deleted')->send(); + + $data['isDeleted'] = $deleted[0]; + + $data['id_rev'] = $clean['id_rev']; + $data['id_hard'] = $clean['id_hard']; + $data['ne_name'] = $this->m['HardwareModel']->getTheModelName($clean['id_hard']); + $data['name'] = encodeUrl($data['ne_name']); + $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($data['id_hard'],$data['name'])." » " . $this->getHistoryLink($clean['id_hard']) . " » make current"; + + $data['notice'] = null; + $this->s['registered']->checkStatus(); + + if ($this->s['registered']->status['status'] === 'logged') + { + if (!$this->s['registered']->checkCsrf($clean['token'])) $this->redirect($this->controller.'/catalogue/'.$this->lang,2,'wrong token..'); + + if (isset($_POST['confirmAction'])) + { + if (strcmp($deleted[0],'no') === 0) + { + $this->m['HardwareModel']->makeCurrent($clean['id_rev']); + + $this->viewRedirect($this->m['HardwareModel']->lastId); + + $data['notice'] = $this->m['HardwareModel']->notice; + } + else + { + $this->redirect($this->controller.'/catalogue/'.$this->lang,2,'deleted..'); + } + } + + $this->append($data); + $this->loadViewAll('climb'); + } + else + { + $this->redirect('users/login/'.$this->lang.'/'.$this->controller.'/view/'.$clean['id_hard'],0); + } + } + } + + protected function talk($lang = 'en', $id_hard = 0, $token = 'token') + { + $this->shift(3); + + $this->m['TalkModel']->setFields('title,message','sanitizeAll'); + + $data['title'] = 'talk - '.Website::$generalName; + + $clean['token'] = sanitizeAlphanum($token); + $clean['id_hard'] = (int)$id_hard; + $data['id_hard'] = $clean['id_hard']; + $data['ne_name'] = $this->m['HardwareModel']->getTheModelName($clean['id_hard']); + $data['name'] = encodeUrl($data['ne_name']); + $data['tree'] = $this->getSpecHardLink() . " » " . $this->getViewLink($clean['id_hard'],$data['name'])." » talk"; + + if (isset($_POST['insertAction'])) + { + if ($this->s['registered']->status['status'] === 'logged') + { + if (!$this->s['registered']->checkCsrf($clean['token'])) $this->redirect($this->controller.'/catalogue/'.$this->lang,2,'wrong token..'); + + $this->m['TalkModel']->values['created_by'] = $this->s['registered']->status['id_user']; + $this->m['TalkModel']->values['id_hard'] = $clean['id_hard']; + + $this->m['TalkModel']->updateTable('insert'); + } + } + + $data['table'] = $this->m['TalkModel']->select()->where(array('id_hard'=>$clean['id_hard']))->orderBy('id_talk')->send(); + + $data['values'] = $this->m['TalkModel']->getFormValues('insert','sanitizeHtml'); + $data['notice'] = $this->m['TalkModel']->notice; + +// javascript for moderator + $data['md_javascript'] = "moderator_dialog(\"hide\",\"talk\");moderator_dialog(\"show\",\"talk\");"; + $data['go_to'] = $this->currPage."/".$this->lang."/".$clean['id_hard']; + + $this->append($data); + $this->loadViewAll('talk,moderator_dialog'); + } + + protected function getViewLink($id,$name) + { + return "controller.'/view/'.$this->lang.'/'.$id.'/'.$name.$this->viewStatus."'>".urldecode($name).""; + } + + protected function getHistoryLink($id) + { + return "controller.'/history/'.$this->lang.'/'.$id.'/'.$this->viewStatus."'>history"; + } + + protected function getSpecHardLink() + { + return "controller.'/catalogue/'.$this->lang.$this->viewStatus."'>".$this->controller.""; + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/HardwareController.php b/h-source/Application/Controllers/HardwareController.php new file mode 100644 index 0000000..6a189ed --- /dev/null +++ b/h-source/Application/Controllers/HardwareController.php @@ -0,0 +1,41 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class HardwareController extends BaseController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['hardware'] = " class='currentitem'"; + + parent::__construct($model, $controller, $queryString); + + $data['title'] = 'hardware - '.Website::$generalName; + $this->append($data); + } + + public function catalogue($lang = 'en') + { + $this->load('left'); + $this->right(); + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/HelpController.php b/h-source/Application/Controllers/HelpController.php new file mode 100644 index 0000000..40908cf --- /dev/null +++ b/h-source/Application/Controllers/HelpController.php @@ -0,0 +1,40 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class HelpController extends BaseController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['help'] = " class='currentitem'"; + + parent::__construct($model, $controller, $queryString); + + $data['title'] = 'help index - '.Website::$generalName; + $this->append($data); + } + + public function index($lang = 'en') + { + $this->cleverLoad('index'); + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/HistoryController.php b/h-source/Application/Controllers/HistoryController.php new file mode 100644 index 0000000..2d965ac --- /dev/null +++ b/h-source/Application/Controllers/HistoryController.php @@ -0,0 +1,185 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class HistoryController extends BaseController +{ + + protected $strings = array( + + 'hide' => array( + + 'action' => 'hide', + 'check_status' => 'no', + 'to_status' => 'yes', + 'exec_string' => 'The message has been hidden. Just reload the page', + 'error_string' => 'Error: the message is already hidden', + + ), + + 'show' => array( + + 'action' => 'show', + 'check_status' => 'yes', + 'to_status' => 'no', + 'exec_string' => 'The message is no more hidden. Just reload the page', + 'error_string' => 'Error: the message is already visible', + + ), + + ); + + protected $types = array( + + 'message' => array( + + 'clean_type' => 'message', + 'model_name' => 'MessagesModel', + 'id_name' => 'id_mes', + + ), + + 'talk' => array( + + 'clean_type' => 'talk', + 'model_name' => 'TalkModel', + 'id_name' => 'id_talk', + + ), + + ); + + public function __construct($model, $controller, $queryString) + { + parent::__construct($model, $controller, $queryString); + + $this->model('HistoryModel'); + + } + + public function hide($lang = 'en', $token = '') + { + $this->generic($lang, $token, 'hide'); + } + + public function show($lang = 'en', $token = '') + { + $this->generic($lang, $token, 'show'); + } + + protected function generic($lang = 'en', $token = '', $action = 'hide') + { + header('Content-type: text/html; charset=UTF-8'); + + $this->shift(2); + + $this->clean(); + + $clean['token'] = sanitizeAlphanum($token); + + if ($this->s['registered']->status['status'] === 'logged') + { + if ($this->ismoderator) + { + if (!$this->s['registered']->checkCsrf($clean['token'])) die("wrong token"); + + $clean['id_user'] = (int)$this->s['registered']->status['id_user']; + $clean['id'] = $this->request->post('id',0,'forceInt'); + $type = $this->request->post('type',0,'sanitizeAll'); + $message = $this->request->post('message',''); + + $modelName = 'error'; + + if (array_key_exists($type,$this->types)) + { + $modelName = $this->types[$type]['model_name']; + $clean['type'] = $this->types[$type]['clean_type']; + $clean['id_name'] = $this->types[$type]['id_name']; + + //load the right model + $this->model($modelName); + $model = $this->m[$modelName]; + + $count = $model->select()->where(array($clean['id_name'] => $clean['id'],'deleted' => $this->strings[$action]['check_status']))->rowNumber(); + + if ($count > 0) + { + if (eg_strlen($message) < 500) + { + //hide the message + $model->values = array('deleted' => $this->strings[$action]['to_status']); + $model->update($clean['id']); + + if ($model->queryResult) + { + $this->m['HistoryModel']->setFields('id:forceInt,type,message','sanitizeAll'); + $this->m['HistoryModel']->values['created_by'] = $clean['id_user']; + $this->m['HistoryModel']->values['action'] = $this->strings[$action]['action']; + $this->m['HistoryModel']->updateTable('insert'); + + echo $this->strings[$action]['exec_string']; + } + else + { + echo "error: one error occurred, please retry later"; + } + } + else + { + echo "error: the message has too many characters or wrong type"; + } + } + else + { + echo $this->strings[$action]['error_string']; + } + } + } + } + } + + public function viewall($lang = 'en', $type = 'message', $id = 0) + { + header('Content-type: text/html; charset=UTF-8'); + + $this->shift(3); + + $this->clean(); + + if ($this->s['registered']->status['status'] === 'logged') + { + if ($this->ismoderator) + { + $clean['id'] = (int)$id; + if (array_key_exists($type,$this->types)) + { + $clean['type'] = $this->types[$type]['clean_type']; + + $data['res'] = $this->m['HistoryModel']->select()->where(array('id'=>$clean['id'],'type'=>$clean['type']))->send(); + + $data['md_action'] = array('hide'=>'hidden','show'=>'restored'); + + $this->append($data); + $this->load('viewall'); + } + } + } + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/HomeController.php b/h-source/Application/Controllers/HomeController.php new file mode 100644 index 0000000..593d7b0 --- /dev/null +++ b/h-source/Application/Controllers/HomeController.php @@ -0,0 +1,58 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class HomeController extends BaseController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['home'] = " class='currentitem'"; + + parent::__construct($model, $controller, $queryString); + + $data['title'] = 'home - '.Website::$generalName; + $this->append($data); + } + + public function index($lang = 'en') + { +// get the news container + $this->m['BoxesModel']->setWhereQueryClause(array('title'=>'home_news')); + $boxes = $this->m['BoxesModel']->getAll('boxes'); + + if (count($boxes) > 0) + { + $xml = htmlspecialchars_decode($boxes[0]['boxes']['message'],ENT_QUOTES); + + $box_news = new BoxParser($xml); + $data['htmlNewsBox'] = $box_news->render(); + } + else + { + $data['htmlNewsBox'] = null; + } + + $this->append($data); + $this->cleverLoad('left'); + $this->right($lang); + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/ImageController.php b/h-source/Application/Controllers/ImageController.php new file mode 100644 index 0000000..471c634 --- /dev/null +++ b/h-source/Application/Controllers/ImageController.php @@ -0,0 +1,39 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class ImageController extends Controller { + + public function captcha() + { + session_start(); + + $params = array( + 'fontPath' => ROOT.'/External/Fonts/FreeFont/FreeMono.ttf', + 'boxHeight' => 100, + 'boxWidth' => 200, + 'undulation'=> true, + 'align' => false + ); + + $captcha = new Image_Gd_Captcha($params); + $captcha->render(); + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/IssuesController.php b/h-source/Application/Controllers/IssuesController.php new file mode 100644 index 0000000..02f6499 --- /dev/null +++ b/h-source/Application/Controllers/IssuesController.php @@ -0,0 +1,171 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class IssuesController extends BaseController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['issues'] = " class='currentitem'"; + + parent::__construct($model, $controller, $queryString); + + $this->model('IssuesModel'); + $this->model('MessagesModel'); + + $argKeys = array( + 'page:forceNat' => 1, + 'token:sanitizeAlphanum' => 'token' + ); + + $this->setArgKeys($argKeys); + + $this->m['IssuesModel']->setFields('title,topic,priority,message','sanitizeAll'); + + $data['title'] = 'issues - '.Website::$generalName; + $this->append($data); + } + + public function viewall($lang = 'en') + { + $this->shift(1); + + $data['preview_message'] = null; + + if (isset($_POST['insertAction'])) + { + if ($this->s['registered']->status['status'] === 'logged') + { + if (!$this->s['registered']->checkCsrf($this->viewArgs['token'])) $this->redirect('home/index'.$this->lang,2,'wrong token..'); + + //set the page to 1 in the viewStatus + $this->viewArgs['page'] = 1; + $this->buildStatus(); + + $this->m['IssuesModel']->values['created_by'] = (int)$this->s['registered']->status['id_user']; + $this->m['IssuesModel']->values['status'] = 'opened'; + + $this->m['IssuesModel']->updateTable('insert'); + } + } + + //if preview + if (isset($_POST['previewAction'])) + { + if ($this->s['registered']->status['status'] === 'logged') + { + if (!$this->s['registered']->checkCsrf($this->viewArgs['token'])) $this->redirect('home/index'.$this->lang,2,'wrong token..'); + + $data['preview_message'] = $this->request->post('message','','sanitizeHtml'); + $this->m['IssuesModel']->result = false; + } + } + + $data['notice'] = $this->m['IssuesModel']->notice; + + $this->m['IssuesModel']->setForm('issues/viewall/'.$this->lang.$this->viewStatus."#form",array('previewAction'=>'preview','insertAction'=>'submit')); + + $values = $this->m['IssuesModel']->getFormValues('insert','sanitizeHtml'); + + $data['form'] = $this->m['IssuesModel']->form->render($values); + + //load the Pages helper + $this->helper('Pages',$this->controller.'/viewall/'.$this->lang,'page'); + //get the number of records + $this->m['IssuesModel']->from('issues left join messages')->using('id_issue')->aWhere(array('deleted'=>'no'))->groupBy('issues.id_issue'); + + $recordNumber = $this->m['IssuesModel']->rowNumber(); + $page = $this->viewArgs['page']; + //set the limit clause + $this->m['IssuesModel']->limit = $this->h['Pages']->getLimit($page,$recordNumber,20); +// $data['table'] = $this->m['IssuesModel']->getFields('id_issue,created_by,title,status,creation_date,topic,priority'); + $data['table'] = $this->m['IssuesModel']->getFields('issues.*,messages.message,count(*) as numb_mess'); + + $data['pageList'] = $this->h['Pages']->render($page-3,7); + + $this->append($data); + $this->load('viewall'); + $this->right(); + } + + public function view($lang = 'en', $id_issue = 0) + { + $this->m['MessagesModel']->setFields('message','sanitizeAll'); + + $this->shift(2); + + $clean['id_issue'] = (int)$id_issue; + $data['id_issue'] = $clean['id_issue']; + $data['preview_message'] = null; + + //if submit + if (isset($_POST['insertAction'])) + { + if ($this->s['registered']->status['status'] === 'logged') + { + if (!$this->s['registered']->checkCsrf($this->viewArgs['token'])) $this->redirect('home/index'.$this->lang,2,'wrong token..'); + + $this->m['MessagesModel']->values['created_by'] = (int)$this->s['registered']->status['id_user']; + $this->m['MessagesModel']->values['id_issue'] = $clean['id_issue']; + $this->m['MessagesModel']->updateTable('insert'); + } + } + + //if preview + if (isset($_POST['previewAction'])) + { + if ($this->s['registered']->status['status'] === 'logged') + { + if (!$this->s['registered']->checkCsrf($this->viewArgs['token'])) $this->redirect('home/index'.$this->lang,2,'wrong token..'); + + $data['preview_message'] = $this->request->post('message','','sanitizeHtml'); + $this->m['MessagesModel']->result = false; + } + } + + $data['notice'] = $this->m['MessagesModel']->notice; + + //create the form + $this->m['MessagesModel']->setForm('issues/view/'.$this->lang."/".$clean['id_issue'].$this->viewStatus."#form",array('previewAction'=>'preview','insertAction'=>'submit')); + + $values = $this->m['MessagesModel']->getFormValues('insert','sanitizeHtml'); + + $data['form'] = $this->m['MessagesModel']->form->render($values); + + //retrieve the values from the table + $data['table'] = $this->m['IssuesModel']->select('id_issue,created_by,title,status,creation_date,topic,priority,message,notice')->where(array('id_issue'=>$clean['id_issue'],'deleted'=>'no'))->send(); + +// javascript for moderator + $data['md_javascript'] = "moderator_dialog(\"hide\",\"message\");moderator_dialog(\"show\",\"message\");"; + $data['go_to'] = $this->currPage."/".$this->lang."/".$clean['id_issue']; + + if (count($data['table']) > 0) + { + $data['messages'] = $this->m['MessagesModel']->select()->where(array('id_issue'=>$clean['id_issue']))->send(); + + $this->append($data); + $this->load('view'); + $this->load('moderator_dialog'); + $this->right(); + } + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/MyController.php b/h-source/Application/Controllers/MyController.php new file mode 100644 index 0000000..75cf794 --- /dev/null +++ b/h-source/Application/Controllers/MyController.php @@ -0,0 +1,209 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class MyController extends BaseController +{ + + public function __construct($model, $controller, $queryString) { + parent::__construct($model, $controller, $queryString); + + $this->model('UsersModel'); + $this->model('ProfileModel'); + + $argKeys = array( + 'token:sanitizeAlphanum' => 'token' + ); + + $this->setArgKeys($argKeys); + + $data['title'] = 'my panel'; + $this->append($data); + } + + public function home($lang = 'en') + { + $this->shift(1); + + $data['title'] = 'my panel - '.Website::$generalName; + + $this->s['registered']->check(); + $clean['id_user'] = (int)$this->s['registered']->status['id_user']; + $data['username'] = $this->m['UsersModel']->getUser($clean['id_user']); + + $this->append($data); + $this->load('panel'); + $this->right($this->lang); + } + + public function password($lang = 'en') + { + $this->shift(1); + + $data['title'] = 'password - '.Website::$generalName; + + $this->s['registered']->check(); + + if (!$this->s['registered']->checkCsrf($this->viewArgs['token'])) $this->redirect($this->controller.'/home/'.$this->lang,2,'wrong token..'); + + $this->m['UsersModel']->setFields('password:sha1','none'); + + $this->m['UsersModel']->strongConditions['update'] = array('checkEqual'=>'password,confirmation'); + + $data['notice'] = null; + + $clean['id_user'] = (int)$this->s['registered']->status['id_user']; + + if (isset($_POST['updateAction'])) { + $pass = $this->s['registered']->getPassword(); + if (sha1($_POST['old']) === $pass) + { + $this->m['UsersModel']->updateTable('update',$clean['id_user']); + $data['notice'] = $this->m['UsersModel']->notice; + if ($this->m['UsersModel']->queryResult) + { + $this->s['registered']->logout(); + $this->redirect('home/index/'.$this->lang,2,'logout'); + } + } + else + { + $data['notice'] = "
The old password is wrong
\n"; + } + } + + $values = $this->m['UsersModel']->selectId($clean['id_user']); + $values['old'] = ''; + $values['confirmation'] = ''; + + $action = array('updateAction'=>'save'); + $form = new Form_Form('my/password/'.$this->lang.$this->viewStatus,$action); + $form->setEntry('old','Password'); + $form->entry['old']->labelString = 'old password:'; + $form->setEntry('password','Password'); + $form->setEntry('confirmation','Password'); + $data['form'] = $form->render($values,'old,password,confirmation'); + + $this->append($data); + + $this->load('password'); + $this->right(); + } + + public function email($lang = 'en') + { + $this->shift(1); + + $data['title'] = 'email - '.Website::$generalName; + + $this->s['registered']->check(); + + if (!$this->s['registered']->checkCsrf($this->viewArgs['token'])) $this->redirect($this->controller.'/home/'.$this->lang,2,'wrong token..'); + + $this->m['UsersModel']->setFields('e_mail','sanitizeAll'); + + $this->m['UsersModel']->strongConditions['update'] = array('checkMail'=>'e_mail'); + + $this->m['UsersModel']->databaseConditions['update'] = array('checkUniqueCompl'=>'e_mail'); + + $data['notice'] = null; + + $clean['id_user'] = (int)$this->s['registered']->status['id_user']; + + $this->m['UsersModel']->updateTable('update',$clean['id_user']); + $data['notice'] = $this->m['UsersModel']->notice; + + $values = $this->m['UsersModel']->selectId($clean['id_user']); + + $action = array('updateAction'=>'save'); + $form = new Form_Form('my/email/'.$this->lang.$this->viewStatus,$action); + $form->setEntry('e_mail','InputText'); + $form->entry['e_mail']->labelString = 'your e-mail address:'; + $data['form'] = $form->render($values,'e_mail'); + + $this->append($data); + + $this->load('email'); + $this->right(); + } + + public function profile($lang = 'en') + { + $this->shift(1); + + $data['title'] = 'profile - '.Website::$generalName; + + $this->s['registered']->check(); + + if (!$this->s['registered']->checkCsrf($this->viewArgs['token'])) $this->redirect($this->controller.'/home/'.$this->lang,2,'wrong token..'); + + $this->m['ProfileModel']->setFields('real_name,website,where_you_are,birth_date,fav_distro,projects,publish_mail,description','sanitizeAll'); + + $clean['id_user'] = (int)$this->s['registered']->status['id_user']; + + $res = $this->m['ProfileModel']->db->select('profile','id_prof','created_by='.$clean['id_user']); + $clean['id_prof'] = (int)$res[0]['profile']['id_prof']; + + $this->m['ProfileModel']->values['update_date'] = date('Y-m-d H:i:s'); + $this->m['ProfileModel']->updateTable('update',$clean['id_prof']); + $data['notice'] = $this->m['ProfileModel']->notice; + + $values = $this->m['ProfileModel']->getFormValues('update','sanitizeHtml',$clean['id_prof']); + + $this->m['ProfileModel']->setForm('my/profile/'.$this->lang.$this->viewStatus,array('updateAction'=>'save'),'POST'); + $data['form'] = $this->m['ProfileModel']->form->render($values); + + $this->append($data); + + $this->load('profile'); + $this->right(); + } + + public function goodbye($lang = 'en') + { + $data['title'] = 'delete - '.Website::$generalName; + + session_start(); + + $this->shift(1); + + $this->s['registered']->check(); + + if (!$this->s['registered']->checkCsrf($this->viewArgs['token'])) $this->redirect($this->controller.'/home/'.$this->lang,2,'wrong token..'); + + $clean['id_user'] = (int)$this->s['registered']->status['id_user']; + + if (isset($_POST['closeAction'])) + { + $this->s['registered']->logout(); + $this->m['UsersModel']->close($clean['id_user']); + + if ($this->m['UsersModel']->queryResult) + { + $this->redirect('users/notice/'.$this->lang); + } + + } + + $this->append($data); + $this->load('goodbye'); + $this->right(); + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/NewsController.php b/h-source/Application/Controllers/NewsController.php new file mode 100644 index 0000000..5b7d0e4 --- /dev/null +++ b/h-source/Application/Controllers/NewsController.php @@ -0,0 +1,65 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class NewsController extends BaseController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['news'] = " class='currentitem'"; + + parent::__construct($model, $controller, $queryString); + + $this->model('NewsModel'); + + $data['title'] = 'news - '.Website::$generalName; + $this->append($data); + } + + public function index($lang = 'en') + { + $argKeys = array( + 'page:forceNat' => 1, + ); + + $this->setArgKeys($argKeys); + + $this->shift(1); + + $this->helper('Pages',$this->controller.'/index/'.$this->lang,'page'); + $this->h['Pages']->nextString = 'older news'; + $this->h['Pages']->previousString = 'latest news'; + $page = $this->viewArgs['page']; + $recordNumber = $this->m['NewsModel']->rowNumber(); + $data['recordNumber'] = $recordNumber; + + //set the limit clause + $limit = $this->h['Pages']->getLimit($page,$recordNumber,10); + + $data['table'] = $this->m['NewsModel']->select()->limit($limit)->send(); + $data['pageList'] = $this->h['Pages']->render($page,0); + + $this->append($data); + $this->load('index'); + $this->right($lang); + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/NotebooksController.php b/h-source/Application/Controllers/NotebooksController.php new file mode 100644 index 0000000..4a40612 --- /dev/null +++ b/h-source/Application/Controllers/NotebooksController.php @@ -0,0 +1,162 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class NotebooksController extends GenericController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['hardware'] = " class='currentitem'"; + + parent::__construct($model, $controller, $queryString); + + //load the model + $this->model('HardwareModel'); + $this->model('RevisionsModel'); + $this->model('NotebooksModel'); + $this->model('TalkModel'); + + $this->mod = $this->m['NotebooksModel']; + + $this->m['HardwareModel']->id_user = $this->s['registered']->status['id_user']; + $this->m['HardwareModel']->type = 'notebook'; + + //hardware conditions + $this->m['HardwareModel']->strongConditions['update'] = array( + "checkIsStrings|".Notebooks::vendorsList() => "vendor", + "checkNotEmpty" => "model|you have to fill the model name entry", + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\(\)]+$/" => "model|characters not allowed in the model name entry", + "+checkIsStrings|".Notebooks::compatibilityList() => "compatibility", + "checkLength|99" => "model", + "+checkLength|299" => "distribution", + "++checkIsStrings|".Notebooks::$commYear => "comm_year", + "+++checkIsStrings|".Notebooks::$subtypeSelect => "subtype", + "++++checkIsStrings|".Notebooks::wifiList() => "wifi_works", + "+++++checkIsStrings|".Notebooks::videoList() => "video_card_works", + ); + + $this->m['HardwareModel']->strongConditions['insert'] = array( + "checkIsStrings|".Notebooks::vendorsList() => "vendor", + "checkNotEmpty" => "model|you have to fill the model name entry", + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\(\)]+$/" => "model|characters not allowed in the model name entry", + "+checkIsStrings|".Notebooks::compatibilityList() => "compatibility", + "checkLength|99" => "model", + "+checkLength|299" => "distribution", + "++checkIsStrings|".Notebooks::$commYear => "comm_year", + "+++checkIsStrings|".Notebooks::$subtypeSelect => "subtype", + "++++checkIsStrings|".Notebooks::wifiList() => "wifi_works", + "+++++checkIsStrings|".Notebooks::videoList() => "video_card_works", + ); + + $this->m['HardwareModel']->softConditions['update'] = array( + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s]+$/" => "kernel|characters not allowed in the kernel entry", + "checkLength|20000" => "description", + "++checkLength|99" => "video_card_type,wifi_type", + "+++checkLength|49" => "kernel", + "+checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\/\,\:\;\(\)\[\]]+$/" => "video_card_type|only the following characters are allowed for the videocard entry: a-z A-Z 0-9 - _ . + s / , : ; ( ) [ ]", + "++checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\/\,\:\;\(\)\[\]]+$/" => "wifi_type|only the following characters are allowed for the wifi entry: a-z A-Z 0-9 - _ . + s / , : ; ( ) [ ]", + ); + + $this->m['HardwareModel']->softConditions['insert'] = array( + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s]+$/" => "kernel|characters not allowed in the kernel entry", + "checkLength|20000" => "description", + "++checkLength|99" => "video_card_type,wifi_type", + "+++checkLength|49" => "kernel", + "+checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\/\,\:\;\(\)\[\]]+$/" => "video_card_type|only the following characters are allowed for the videocard entry: a-z A-Z 0-9 - _ . + s / , : ; ( ) [ ]", + "++checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\/\,\:\;\(\)\[\]]+$/" => "wifi_type|only the following characters are allowed for the wifi entry: a-z A-Z 0-9 - _ . + s / , : ; ( ) [ ]", + ); + + $this->m['HardwareModel']->setFields('vendor,model,compatibility,kernel,description,distribution,video_card_type,video_card_works,wifi_type,wifi_works,comm_year,subtype','sanitizeAll'); + + $argKeys = array( + 'page:forceNat' => 1, + 'history_page:forceNat' => 1, + 'vendor:sanitizeString' => 'undef', + 'compatibility:sanitizeString' => 'undef', + 'comm_year:sanitizeString' => 'undef', + 'subtype:sanitizeString' => 'undef', + 'sort-by:sanitizeString' => 'undef' + ); + + $this->setArgKeys($argKeys); + + $data['title'] = 'Notebooks'; + $this->append($data); + } + + public function catalogue($lang = 'en') + { + $this->shift(1); + + $whereArray = array( + 'type' => $this->mod->type, + 'vendor' => $this->viewArgs['vendor'], + 'comm_year' => $this->viewArgs['comm_year'], + 'subtype' => $this->viewArgs['subtype'], + 'compatibility' => $this->viewArgs['compatibility'] + ); + + $this->mod->setWhereQueryClause($whereArray); + + parent::catalogue($lang); + } + + public function view($lang = 'en', $id = 0, $name = null) + { + parent::view($lang, $id, $name); + } + + public function history($lang = 'en', $id = 0) + { + parent::history($lang, $id); + } + + public function revision($lang = 'en', $id_rev = 0) + { + parent::revision($lang, $id_rev); + } + + public function insert($lang = 'en', $token = '') + { + parent::insert($lang, $token); + } + + public function update($lang = 'en', $token = '') + { + parent::update($lang, $token); + } + + public function differences($lang = 'en', $id_hard = 0, $id_rev = 0) + { + parent::differences($lang, $id_hard, $id_rev); + } + + public function climb($lang = 'en', $id_rev = 0, $token = '') + { + parent::climb($lang, $id_rev, $token); + } + + public function talk($lang = 'en', $id_hard = 0, $token = '') + { + parent::talk($lang, $id_hard, $token); + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/PrintersController.php b/h-source/Application/Controllers/PrintersController.php new file mode 100644 index 0000000..50da908 --- /dev/null +++ b/h-source/Application/Controllers/PrintersController.php @@ -0,0 +1,158 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class PrintersController extends GenericController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['hardware'] = " class='currentitem'"; + + parent::__construct($model, $controller, $queryString); + + //load the model + $this->model('HardwareModel'); + $this->model('RevisionsModel'); + $this->model('PrintersModel'); + $this->model('TalkModel'); + + $this->mod = $this->m['PrintersModel']; + + $this->m['HardwareModel']->id_user = $this->s['registered']->status['id_user']; + $this->m['HardwareModel']->type = 'printer'; + + //hardware conditions + $this->m['HardwareModel']->strongConditions['update'] = array( + "checkIsStrings|".Printer::vendorsList() => "vendor", + "checkNotEmpty" => "model|you have to fill the model name entry", + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\(\)]+$/" => "model|characters not allowed in the model name entry", + "checkLength|99" => "model", + "+checkLength|299" => "distribution", + "+checkIsStrings|".Printer::compatibilityList() => "compatibility", + "++checkIsStrings|".Printer::$commYear => "comm_year", + "+++checkIsStrings|".Printer::$interface => "interface", + ); + + $this->m['HardwareModel']->strongConditions['insert'] = array( + "checkIsStrings|".Printer::vendorsList() => "vendor", + "checkNotEmpty" => "model|you have to fill the model name entry", + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\(\)]+$/" => "model|characters not allowed in the model name entry", + "checkLength|99" => "model", + "+checkLength|299" => "distribution", + "+checkIsStrings|".Printer::compatibilityList() => "compatibility", + "++checkIsStrings|".Printer::$commYear => "comm_year", + "+++checkIsStrings|".Printer::$interface => "interface", + ); + + $this->m['HardwareModel']->softConditions['update'] = array( + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s]+$/" => "kernel|characters not allowed in the kernel entry", + "checkLength|20000" => "description", + "+checkLength|49" => "driver", + "++checkLength|49" => "kernel", + "+checkMatch|/^[a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}$/" => "pci_id|VendorID:ProductID has to have the following format: [a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}", + "++checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\/\,\:\;\(\)\[\]]+$/" => "driver|only the following characters are allowed for the driver entry: a-z A-Z 0-9 - _ . + s / , : ; ( ) [ ]", + ); + + $this->m['HardwareModel']->softConditions['insert'] = array( + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s]+$/" => "kernel|characters not allowed in the kernel entry", + "checkLength|20000" => "description", + "+checkLength|49" => "driver", + "++checkLength|49" => "kernel", + "+checkMatch|/^[a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}$/" => "pci_id|VendorID:ProductID has to have the following format: [a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}", + "++checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\/\,\:\;\(\)\[\]]+$/" => "driver|only the following characters are allowed for the driver entry: a-z A-Z 0-9 - _ . + s / , : ; ( ) [ ]", + ); + + $this->m['HardwareModel']->setFields('vendor,model,kernel,description,compatibility,distribution,comm_year,pci_id,driver,interface','sanitizeAll'); + + $argKeys = array( + 'page:forceNat' => 1, + 'history_page:forceNat' => 1, + 'vendor:sanitizeString' => 'undef', + 'compatibility:sanitizeString' => 'undef', + 'comm_year:sanitizeString' => 'undef', + 'interface:sanitizeString' => 'undef', + 'sort-by:sanitizeString' => 'undef', + ); + + $this->setArgKeys($argKeys); + + $data['title'] = 'printers'; + $this->append($data); + } + + public function catalogue($lang = 'en') + { + $this->shift(1); + + $whereArray = array( + 'type' => $this->mod->type, + 'vendor' => $this->viewArgs['vendor'], + 'compatibility' => $this->viewArgs['compatibility'], + 'comm_year' => $this->viewArgs['comm_year'], + 'interface' => $this->viewArgs['interface'], + ); + + $this->mod->setWhereQueryClause($whereArray); + + parent::catalogue($lang); + } + + public function view($lang = 'en', $id = 0, $name = null) + { + parent::view($lang, $id, $name); + } + + public function history($lang = 'en', $id = 0) + { + parent::history($lang, $id); + } + + public function revision($lang = 'en', $id_rev = 0) + { + parent::revision($lang, $id_rev); + } + + public function insert($lang = 'en', $token = '') + { + parent::insert($lang, $token); + } + + public function update($lang = 'en', $token = '') + { + parent::update($lang, $token); + } + + public function differences($lang = 'en', $id_hard = 0, $id_rev = 0) + { + parent::differences($lang, $id_hard, $id_rev); + } + + public function climb($lang = 'en', $id_rev = 0, $token = '') + { + parent::climb($lang, $id_rev, $token); + } + + public function talk($lang = 'en', $id_hard = 0, $token = '') + { + parent::talk($lang, $id_hard, $token); + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/ProjectController.php b/h-source/Application/Controllers/ProjectController.php new file mode 100644 index 0000000..e114f75 --- /dev/null +++ b/h-source/Application/Controllers/ProjectController.php @@ -0,0 +1,38 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class ProjectController extends BaseController +{ + + public function __construct($model, $controller, $queryString) + { + parent::__construct($model, $controller, $queryString); + + $data['title'] = 'project - '.Website::$generalName; + $this->append($data); + } + + public function index($lang = 'en') + { + $this->cleverLoad('index'); + $this->right(); + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/ScannersController.php b/h-source/Application/Controllers/ScannersController.php new file mode 100644 index 0000000..f4206d5 --- /dev/null +++ b/h-source/Application/Controllers/ScannersController.php @@ -0,0 +1,158 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class ScannersController extends GenericController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['hardware'] = " class='currentitem'"; + + parent::__construct($model, $controller, $queryString); + + //load the model + $this->model('HardwareModel'); + $this->model('RevisionsModel'); + $this->model('ScannersModel'); + $this->model('TalkModel'); + + $this->mod = $this->m['ScannersModel']; + + $this->m['HardwareModel']->id_user = $this->s['registered']->status['id_user']; + $this->m['HardwareModel']->type = 'scanner'; + + //hardware conditions + $this->m['HardwareModel']->strongConditions['update'] = array( + "checkIsStrings|".Printer::vendorsList() => "vendor", + "checkNotEmpty" => "model|you have to fill the model name entry", + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\(\)]+$/" => "model|characters not allowed in the model name entry", + "checkLength|99" => "model", + "+checkLength|299" => "distribution", + "+checkIsStrings|".Printer::compatibilityList() => "compatibility", + "++checkIsStrings|".Printer::$commYear => "comm_year", + "+++checkIsStrings|".Printer::$interface => "interface", + ); + + $this->m['HardwareModel']->strongConditions['insert'] = array( + "checkIsStrings|".Printer::vendorsList() => "vendor", + "checkNotEmpty" => "model|you have to fill the model name entry", + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\(\)]+$/" => "model|characters not allowed in the model name entry", + "checkLength|99" => "model", + "+checkLength|299" => "distribution", + "+checkIsStrings|".Printer::compatibilityList() => "compatibility", + "++checkIsStrings|".Printer::$commYear => "comm_year", + "+++checkIsStrings|".Printer::$interface => "interface", + ); + + $this->m['HardwareModel']->softConditions['update'] = array( + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s]+$/" => "kernel|characters not allowed in the kernel entry", + "checkLength|20000" => "description", + "+checkLength|49" => "driver", + "++checkLength|49" => "kernel", + "+checkMatch|/^[a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}$/" => "pci_id|VendorID:ProductID has to have the following format: [a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}", + "++checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\/\,\:\;\(\)\[\]]+$/" => "driver|only the following characters are allowed for the driver entry: a-z A-Z 0-9 - _ . + s / , : ; ( ) [ ]", + ); + + $this->m['HardwareModel']->softConditions['insert'] = array( + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s]+$/" => "kernel|characters not allowed in the kernel entry", + "checkLength|20000" => "description", + "+checkLength|49" => "driver", + "++checkLength|49" => "kernel", + "+checkMatch|/^[a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}$/" => "pci_id|VendorID:ProductID has to have the following format: [a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}", + "++checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\/\,\:\;\(\)\[\]]+$/" => "driver|only the following characters are allowed for the driver entry: a-z A-Z 0-9 - _ . + s / , : ; ( ) [ ]", + ); + + $this->m['HardwareModel']->setFields('vendor,model,kernel,description,compatibility,distribution,comm_year,pci_id,driver,interface','sanitizeAll'); + + $argKeys = array( + 'page:forceNat' => 1, + 'history_page:forceNat' => 1, + 'vendor:sanitizeString' => 'undef', + 'compatibility:sanitizeString' => 'undef', + 'comm_year:sanitizeString' => 'undef', + 'interface:sanitizeString' => 'undef', + 'sort-by:sanitizeString' => 'undef', + ); + + $this->setArgKeys($argKeys); + + $data['title'] = 'scanners'; + $this->append($data); + } + + public function catalogue($lang = 'en') + { + $this->shift(1); + + $whereArray = array( + 'type' => $this->mod->type, + 'vendor' => $this->viewArgs['vendor'], + 'compatibility' => $this->viewArgs['compatibility'], + 'comm_year' => $this->viewArgs['comm_year'], + 'interface' => $this->viewArgs['interface'], + ); + + $this->mod->setWhereQueryClause($whereArray); + + parent::catalogue($lang); + } + + public function view($lang = 'en', $id = 0, $name = null) + { + parent::view($lang, $id, $name); + } + + public function history($lang = 'en', $id = 0) + { + parent::history($lang, $id); + } + + public function revision($lang = 'en', $id_rev = 0) + { + parent::revision($lang, $id_rev); + } + + public function insert($lang = 'en', $token = '') + { + parent::insert($lang, $token); + } + + public function update($lang = 'en', $token = '') + { + parent::update($lang, $token); + } + + public function differences($lang = 'en', $id_hard = 0, $id_rev = 0) + { + parent::differences($lang, $id_hard, $id_rev); + } + + public function climb($lang = 'en', $id_rev = 0, $token = '') + { + parent::climb($lang, $id_rev, $token); + } + + public function talk($lang = 'en', $id_hard = 0, $token = '') + { + parent::talk($lang, $id_hard, $token); + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/SearchController.php b/h-source/Application/Controllers/SearchController.php new file mode 100644 index 0000000..2d8a1a8 --- /dev/null +++ b/h-source/Application/Controllers/SearchController.php @@ -0,0 +1,90 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class SearchController extends BaseController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['search'] = " class='currentitem'"; + + parent::__construct($model, $controller, $queryString); + + $this->model('HardwareModel'); + + $data['title'] = 'search - '.Website::$generalName; + $this->append($data); + } + + public function form($lang = 'en') + { + $this->cleverLoad('form'); + $this->right(); + } + + public function results($lang = 'en') + { + Params::$nullQueryValue = 'undef'; + + $argKeys = array( + 'page:forceNat' => 1, + 'action:sanitizeAlphanum' => 'search', + 'type:sanitizeAlphanum' => 'notebook', + 'model:sanitizeString' => 'undef', + ); + + $this->setArgKeys($argKeys); + + $this->shift(1); + + if (strcmp($this->viewArgs['action'],'search') === 0) + { + Params::$whereClauseSymbolArray = array('like'); + + $whereClause = array( + 'type' => $this->viewArgs['type'], + 'model' => "like '%".$this->viewArgs['model']."%'", + '-deleted' => "no", + ); + + $recordNumber = $this->m['HardwareModel']->clear()->where($whereClause)->orderBy("id_hard desc")->rowNumber(); + + $data['recordNumber'] = $recordNumber; + + //load the Pages helper + $this->helper('Pages',$this->controller.'/results/'.$this->lang,'page'); + $page = $this->viewArgs['page']; + //set the limit clause + $limit = $this->h['Pages']->getLimit($page,$recordNumber,10); + + $data['table'] = $this->m['HardwareModel']->clear()->select('id_hard,model,type,comm_year')->where($whereClause)->limit($limit)->orderBy("id_hard desc")->send(); +// echo $this->m['HardwareModel']->getQuery(); + + $data['pageList'] = $this->h['Pages']->render($page-3,7); + + $this->append($data); + $this->cleverLoad('results'); + $this->right(); + } + + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/UsersController.php b/h-source/Application/Controllers/UsersController.php new file mode 100644 index 0000000..6e760ba --- /dev/null +++ b/h-source/Application/Controllers/UsersController.php @@ -0,0 +1,428 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class UsersController extends BaseController +{ + + private $_updating; + + public function __construct($model, $controller, $queryString) + { + parent::__construct($model, $controller, $queryString); + + $this->model('UsersModel'); + $this->model('ProfileModel'); + $this->model('HardwareModel'); + $this->model('ParamsModel'); + + $updating = $this->m['ParamsModel']->select('updating')->where(array('id_par'=>1))->toList('updating')->send(); + $data['updating_flag'] = $updating[0]; + $this->_updating = $data['updating_flag']; + + $data['title'] = 'Login'; + $this->append($data); + } + + public function login($lang = 'en', $type = null,$the_action = null,$the_id = null) + { + $data = array(); + + if ( strcmp($this->_updating,'no') === 0 ) + { + $data['flag'] = isset($type) ? 'setted' : null; + $html['type'] = in_array($type,Hardware::$controllers) ? sanitizeAll($type) : 'notebooks'; + $html['the_action'] = sanitizeAlphanum($the_action); + $html['the_id'] = (int)$the_id; + $html['lang'] = Lang::sanitize($lang); + + $data['title'] = 'Login - '.Website::$generalName; + + if (isset($type)) + { + $data['action'] = Url::getRoot("users/login/".$html['lang']."/".$html['type']."/".$html['the_action']."/".$html['the_id']); + } + else + { + $data['action'] = Url::getRoot("users/login/".$html['lang']); + } + + $data['notice'] = null; + + $this->s['registered']->checkStatus(); + + if ($this->s['registered']->status['status']=='logged') { //check if already logged + $this->s['registered']->redirect('logged'); + } + if (isset($_POST['username']) and isset($_POST['password'])) + { + $username = ctype_alnum($_POST['username']) ? sanitizeAll($_POST['username']) : ''; + $choice = $this->s['registered']->login($username,$_POST['password']); + + switch($choice) { + case 'logged': + $this->redirect('home/index',3,'You are already logged...'); + break; + case 'accepted': + if (isset($type)) + { + $address = strcmp($html['the_action'],'view') === 0 ? $html['type']."/view/".$html['lang']."/".$html['the_id'] : $html['type']."/catalogue/".$html['lang']; + + $this->redirect($address,0); + } + else + { + $this->redirect('home/index',0); + } + break; + case 'login-error': + $data['notice'] = '
Wrong username or password
'; + break; + case 'wait': + $data['notice'] = '
You have to wait 5 seconds before you can try to login another time
'; + break; + } + } + } + + $this->append($data); + $this->load('login'); + } + + public function logout($lang = 'en') + { + $res = $this->s['registered']->logout(); + + if ($res === 'not-logged') + { + $data['notice'] = "
You can't logout because you are not logged..
\n"; + } + else if ($res === 'was-logged') + { + $this->redirect('home',0); + } + else if ($res === 'error') + { + + } + + $this->append($data); + $this->load('logout'); + } + + public function add($lang = 'en') + { + $data['title'] = 'create account - '.Website::$generalName; + + if ( strcmp($this->_updating,'no') === 0 ) + { + //start session for captcha + session_start(); + + if ( isset($_SESSION['status']) ) unset($_SESSION['status']); + + $this->shift(1); + + $this->m['UsersModel']->strongConditions['insert'] = array( + "checkAlphanum" => "username", + "checkLength|35" => "username", + "checkMail" => "e_mail", + "+checkLength|35" => "e_mail", + "checkEqual" => "password,confirmation", + "checkMatch|/^[a-zA-Z0-9\_\-\!]+$/" => "password,confirmation|characters allowed for the password: a-z A-Z 0-9 - _ !" + ); + + $this->m['UsersModel']->databaseConditions['insert'] = array( + "checkUnique" => "username", + "+checkUnique" => "e_mail" + ); + + if ($this->s['registered']->status['status'] === 'logged') + { + $this->redirect('home/index/'.$this->lang,2,'you are already logged..'); + } + else + { + $data['notice'] = null; + + $this->m['UsersModel']->setFields('username:sanitizeAll,e_mail:sanitizeAll,password:sha1','none'); + + $this->m['UsersModel']->updateTable('insert'); + + $data['notice'] = $this->m['UsersModel']->notice; + + $values = $this->m['UsersModel']->getFormValues('insert','sanitizeHtml'); + $values['confirmation'] = ''; + + $data['values'] = $values; + + $this->append($data); + + $this->load('add'); + $this->right(); + } + } + else + { + $this->redirect('users/login/'.$this->lang,0); + } + } + + public function confirm($lang = 'en', $id_user = 0, $confirmation_token = '') + { + $data['title'] = 'confirm account - '.Website::$generalName; + + if ( strcmp($this->_updating,'no') === 0 ) + { + if ($this->s['registered']->status['status'] === 'logged') + { + $this->redirect('home/index/'.$this->lang,2,'you are already logged..'); + } + else + { + $clean['id_user'] = (int)$id_user; + $clean['confirmation_token'] = sanitizeAlphanum($confirmation_token); + + $data['status_confirm'] = false; + + $res = $this->m['UsersModel']->select('id_user,creation_time')->where(array("id_user"=>$clean['id_user'],"confirmation_token"=>$clean['confirmation_token'],"has_confirmed"=>1,"deleted"=>"no"))->send(); + + // echo $this->m['UsersModel']->getQuery(); + + if (count($res) > 0) + { + $now = time(); + $checkTime = $res[0]['regusers']['creation_time'] + Account::$confirmTime; + if ($checkTime > $now) + { + $this->m['UsersModel']->values = array('has_confirmed' => 0, 'creation_time' => 0); + if ($this->m['UsersModel']->update($clean['id_user'])) + { + $data['status_confirm'] = true; + + //ad a record in the profile table + $this->m['ProfileModel']->values = array('created_by' => $clean['id_user']); + $this->m['ProfileModel']->insert(); + + } + } + } + + // var_dump($data['status_confirm']); + + $this->append($data); + $this->load('confirmation'); + $this->right(); + } + } + else + { + $this->redirect('users/login/'.$this->lang,0); + } + } + + public function change($lang = 'en', $id_user = 0, $forgot_token = '') + { + session_start(); + + $data['title'] = 'change password - '.Website::$generalName; + + if ( strcmp($this->_updating,'no') === 0 ) + { + if ($this->s['registered']->status['status'] === 'logged') + { + $this->redirect('home/index/'.$this->lang,2,'you are already logged..'); + } + else + { + $clean['id_user'] = (int)$id_user; + $clean['forgot_token'] = sanitizeAlphanum($forgot_token); + + $res = $this->m['UsersModel']->select('username,id_user,forgot_time,e_mail')->where(array("id_user"=>$clean['id_user'],"forgot_token"=>$clean['forgot_token'],"has_confirmed"=>0,"deleted"=>"no"))->send(); + + if (count($res) > 0) + { + $now = time(); + $checkTime = $res[0]['regusers']['forgot_time'] + Account::$confirmTime; + if ($checkTime > $now) + { + $username = $res[0]['regusers']['username']; + $email = $res[0]['regusers']['e_mail']; + + $newPassword = generateString(10); + $this->m['UsersModel']->values = array('password' => sha1($newPassword), 'forgot_time' => 0); + if ($this->m['UsersModel']->update($clean['id_user'])) + { + $result = Account::sendpassword($username,$email,$newPassword); + + if ($result) + { + $_SESSION['status'] = 'sent_new_password'; + } + else + { + $_SESSION['status'] = 'sent_new_password_error'; + } + + $hed = new HeaderObj(DOMAIN_NAME); + $hed->redirect('users/notice/'.Lang::$current,1); + + } + } + } + + $this->append($data); + $this->load('change'); + $this->right(); + } + } + else + { + $this->redirect('users/login/'.$this->lang,0); + } + } + + public function forgot($lang = 'en') + { + $data['title'] = 'request password - '.Website::$generalName; + + if ( strcmp($this->_updating,'no') === 0 ) + { + session_start(); + + if ( isset($_SESSION['status']) ) unset($_SESSION['status']); + + $this->shift(1); + + if ($this->s['registered']->status['status'] === 'logged') + { + $this->redirect('home/index/'.$this->lang,2,'you are already logged..'); + } + else + { + $data['notice'] = null; + + if (isset($_POST['forgotAction'])) + { + if (isset($_POST['username'])) + { + $this->m['UsersModel']->forgot($_POST['username']); + $data['notice'] = $this->m['UsersModel']->notice; + } + } + + $this->append($data); + + $this->load('forgot'); + $this->right(); + } + } + else + { + $this->redirect('users/login/'.$this->lang,0); + } + } + + public function notice($lang = 'en') + { + $data['title'] = 'notice - '.Website::$generalName; + + if ( strcmp($this->_updating,'no') === 0 ) + { + session_start(); + if ($this->s['registered']->status['status'] === 'logged') + { + $this->redirect('home/index/'.$this->lang,2,'you are already logged..'); + } + else + { + $this->load('notice'); + $this->right(); + } + } + else + { + $this->redirect('users/login/'.$this->lang,0); + } + } + + public function meet($lang = 'en', $user = '') + { + $clean['user'] = ctype_alnum($user) ? sanitizeAll($user) : ''; + $data['title'] = "meet ".$clean['user']." - ".Website::$generalName; + + if (strcmp($clean['user'],'') !== 0) + { + $this->shift(2); + + $res = $this->m['UsersModel']->db->select('regusers','has_confirmed,deleted,username','username="'.$clean['user'].'" and has_confirmed=0 and deleted="no"'); +// echo $this->m['UsersModel']->getQuery(); + if (count($res) > 0) + { + $whereArray = array( + 'username' => $clean['user'], + 'has_confirmed' => 0, + 'deleted' => 'no' + ); + + $data['table'] = $this->m['ProfileModel']->select('regusers.e_mail,regusers.username,profile.*')->from('regusers inner join profile')->on('regusers.id_user = profile.created_by')->where($whereArray)->send(); + + // echo $this->m['HardwareModel']->getQuery(); + + $data['meet_username'] = $res[0]['regusers']['username']; + + $this->append($data); + $this->load('meet'); + $this->right(); + } + } + } + + public function contributions($lang = 'en', $user = '') + { + $clean['user'] = ctype_alnum($user) ? sanitizeAll($user) : ''; + $data['title'] = $clean['user']." contributions - ".Website::$generalName; + + if (strcmp($clean['user'],'') !== 0) + { + $this->shift(2); + + $res = $this->m['UsersModel']->db->select('regusers','has_confirmed,deleted,username','username="'.$clean['user'].'" and has_confirmed=0 and deleted="no"'); + + if (count($res) > 0) + { + $whereArray = array( + 'username' => $clean['user'], + 'has_confirmed' => 0, + 'deleted' => 'no' + ); + + $data['table'] = $this->m['HardwareModel']->select('hardware.*,regusers.username')->where($whereArray)->send(); + // echo $this->m['HardwareModel']->getQuery(); + + $data['meet_username'] = $res[0]['regusers']['username']; + + $this->append($data); + $this->load('contributions'); + $this->right(); + } + } + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/VideocardsController.php b/h-source/Application/Controllers/VideocardsController.php new file mode 100644 index 0000000..e95fac6 --- /dev/null +++ b/h-source/Application/Controllers/VideocardsController.php @@ -0,0 +1,152 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class VideocardsController extends GenericController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['hardware'] = " class='currentitem'"; + + parent::__construct($model, $controller, $queryString); + + //load the model + $this->model('HardwareModel'); + $this->model('RevisionsModel'); + $this->model('VideocardsModel'); + $this->model('TalkModel'); + + $this->mod = $this->m['VideocardsModel']; + + $this->m['HardwareModel']->id_user = $this->s['registered']->status['id_user']; + $this->m['HardwareModel']->type = 'videocard'; + + //hardware conditions + $this->m['HardwareModel']->strongConditions['update'] = array( + "checkIsStrings|".Videocard::vendorsList() => "vendor", + "checkNotEmpty" => "model|you have to fill the model name entry", + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\(\)]+$/" => "model|characters not allowed in the model name entry", + "checkLength|99" => "model", + "+checkLength|299" => "distribution", + "++checkIsStrings|".Notebooks::$commYear => "comm_year", + "+++checkIsStrings|".Videocard::videoList() => "video_card_works", + "++++checkIsStrings|".Videocard::$interface => "interface", + ); + + $this->m['HardwareModel']->strongConditions['insert'] = array( + "checkIsStrings|".Videocard::vendorsList() => "vendor", + "checkNotEmpty" => "model|you have to fill the model name entry", + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\(\)]+$/" => "model|characters not allowed in the model name entry", + "checkLength|99" => "model", + "+checkLength|299" => "distribution", + "++checkIsStrings|".Notebooks::$commYear => "comm_year", + "+++checkIsStrings|".Videocard::videoList() => "video_card_works", + "++++checkIsStrings|".Videocard::$interface => "interface", + ); + + $this->m['HardwareModel']->softConditions['update'] = array( + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s]+$/" => "kernel|characters not allowed in the kernel entry", + "checkLength|20000" => "description", + "+checkLength|49" => "kernel", + "+checkMatch|/^[a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}$/" => "pci_id|VendorID:ProductID has to have the following format: [a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}", + ); + + $this->m['HardwareModel']->softConditions['insert'] = array( + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s]+$/" => "kernel|characters not allowed in the kernel entry", + "checkLength|20000" => "description", + "+checkLength|49" => "kernel", + "+checkMatch|/^[a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}$/" => "pci_id|VendorID:ProductID has to have the following format: [a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}", + ); + + $this->m['HardwareModel']->setFields('vendor,model,kernel,description,distribution,video_card_works,comm_year,pci_id,interface','sanitizeAll'); + + $argKeys = array( + 'page:forceNat' => 1, + 'history_page:forceNat' => 1, + 'vendor:sanitizeString' => 'undef', + 'comm_year:sanitizeString' => 'undef', + 'interface:sanitizeString' => 'undef', + 'sort-by:sanitizeString' => 'undef', + ); + + $this->setArgKeys($argKeys); + + $data['title'] = 'Videocards'; + $this->append($data); + } + + public function catalogue($lang = 'en') + { + $this->shift(1); + + $whereArray = array( + 'type' => $this->mod->type, + 'vendor' => $this->viewArgs['vendor'], + 'comm_year' => $this->viewArgs['comm_year'], + 'interface' => $this->viewArgs['interface'], + ); + + $this->mod->setWhereQueryClause($whereArray); + + parent::catalogue($lang); + } + + public function view($lang = 'en', $id = 0, $name = null) + { + parent::view($lang, $id, $name); + } + + public function history($lang = 'en', $id = 0) + { + parent::history($lang, $id); + } + + public function revision($lang = 'en', $id_rev = 0) + { + parent::revision($lang, $id_rev); + } + + public function insert($lang = 'en', $token = '') + { + parent::insert($lang, $token); + } + + public function update($lang = 'en', $token = '') + { + parent::update($lang, $token); + } + + public function differences($lang = 'en', $id_hard = 0, $id_rev = 0) + { + parent::differences($lang, $id_hard, $id_rev); + } + + public function climb($lang = 'en', $id_rev = 0, $token = '') + { + parent::climb($lang, $id_rev, $token); + } + + public function talk($lang = 'en', $id_hard = 0, $token = '') + { + parent::talk($lang, $id_hard, $token); + } + +} \ No newline at end of file diff --git a/h-source/Application/Controllers/WifiController.php b/h-source/Application/Controllers/WifiController.php new file mode 100644 index 0000000..8313ffc --- /dev/null +++ b/h-source/Application/Controllers/WifiController.php @@ -0,0 +1,154 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class WifiController extends GenericController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['hardware'] = " class='currentitem'"; + + parent::__construct($model, $controller, $queryString); + + //load the model + $this->model('HardwareModel'); + $this->model('RevisionsModel'); + $this->model('WifiModel'); + $this->model('TalkModel'); + + $this->mod = $this->m['WifiModel']; + + $this->m['HardwareModel']->id_user = $this->s['registered']->status['id_user']; + $this->m['HardwareModel']->type = 'wifi'; + + //hardware conditions + $this->m['HardwareModel']->strongConditions['update'] = array( + "checkIsStrings|".Wifi::vendorsList() => "vendor", + "checkNotEmpty" => "model|you have to fill the model name entry", + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\(\)]+$/" => "model|characters not allowed in the model name entry", + "checkLength|99" => "model", + "+checkLength|299" => "distribution", + "++checkIsStrings|".Wifi::$commYear => "comm_year", + "+++checkIsStrings|".Wifi::$wifiSelect => "wifi_works", + "++++checkIsStrings|".Wifi::$interface => "interface", + ); + + $this->m['HardwareModel']->strongConditions['insert'] = array( + "checkIsStrings|".Wifi::vendorsList() => "vendor", + "checkNotEmpty" => "model|you have to fill the model name entry", + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\(\)]+$/" => "model|characters not allowed in the model name entry", + "checkLength|99" => "model", + "+checkLength|299" => "distribution", + "++checkIsStrings|".Wifi::$commYear => "comm_year", + "+++checkIsStrings|".Wifi::$wifiSelect => "wifi_works", + "++++checkIsStrings|".Wifi::$interface => "interface", + ); + + $this->m['HardwareModel']->softConditions['update'] = array( + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s]+$/" => "kernel|characters not allowed in the kernel entry", + "checkLength|20000" => "description", + "+checkLength|49" => "kernel", + "+checkMatch|/^[a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}$/" => "pci_id|VendorID:ProductID has to have the following format: [a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}", + ); + + $this->m['HardwareModel']->softConditions['insert'] = array( + "checkMatch|/^[a-zA-Z0-9\-\_\.\+\s]+$/" => "kernel|characters not allowed in the kernel entry", + "checkLength|20000" => "description", + "+checkLength|49" => "kernel", + "+checkMatch|/^[a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}$/" => "pci_id|VendorID:ProductID has to have the following format: [a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}", + ); + + $this->m['HardwareModel']->setFields('vendor,model,kernel,description,distribution,comm_year,wifi_works,pci_id,interface','sanitizeAll'); + + $argKeys = array( + 'page:forceNat' => 1, + 'history_page:forceNat' => 1, + 'vendor:sanitizeString' => 'undef', + 'comm_year:sanitizeString' => 'undef', + 'wifi_works:sanitizeString' => 'undef', + 'interface:sanitizeString' => 'undef', + 'sort-by:sanitizeString' => 'undef' + ); + + $this->setArgKeys($argKeys); + + $data['title'] = 'Wifi'; + $this->append($data); + } + + public function catalogue($lang = 'en') + { + $this->shift(1); + + $whereArray = array( + 'type' => $this->mod->type, + 'vendor' => $this->viewArgs['vendor'], + 'comm_year' => $this->viewArgs['comm_year'], + 'wifi_works' => $this->viewArgs['wifi_works'], + 'interface' => $this->viewArgs['interface'], + ); + + $this->mod->setWhereQueryClause($whereArray); + + parent::catalogue($lang); + } + + public function view($lang = 'en', $id = 0, $name = null) + { + parent::view($lang, $id, $name); + } + + public function history($lang = 'en', $id = 0) + { + parent::history($lang, $id); + } + + public function revision($lang = 'en', $id_rev = 0) + { + parent::revision($lang, $id_rev); + } + + public function insert($lang = 'en', $token = '') + { + parent::insert($lang, $token); + } + + public function update($lang = 'en', $token = '') + { + parent::update($lang, $token); + } + + public function differences($lang = 'en', $id_hard = 0, $id_rev = 0) + { + parent::differences($lang, $id_hard, $id_rev); + } + + public function climb($lang = 'en', $id_rev = 0, $token = '') + { + parent::climb($lang, $id_rev, $token); + } + + public function talk($lang = 'en', $id_hard = 0, $token = '') + { + parent::talk($lang, $id_hard, $token); + } + +} \ No newline at end of file diff --git a/h-source/Application/Hooks/AfterInitialization.php b/h-source/Application/Hooks/AfterInitialization.php new file mode 100644 index 0000000..a369309 --- /dev/null +++ b/h-source/Application/Hooks/AfterInitialization.php @@ -0,0 +1,10 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class Distributions +{ + + public static $allowed = array( + 'blag_90001' => 'BLAG 90001', + 'blag_120000' => 'BLAG 120000', + 'dragora_1_1' => 'Dragora 1.1', + 'dynebolic_2_5_2' => 'Dynebolic 2.5.2 DHORUBA', + 'gnewsense_2_3' => 'gNewSense 2.3 Deltah', + 'gnewsense_3_0' => 'gNewSense 3.0 Metad', + 'musix_2_0' => 'Musix GNU+Linux 2.0 R0', + 'trisquel_3_5' => 'Trisquel 3.5 Awen', + 'trisquel_4_0' => 'Trisquel 4.0 Taranis', + 'ututo_xs_2009' => 'UTUTO XS 2009', + 'ututo_xs_2010' => 'UTUTO XS 2010', + 'venenux_0_8' => 'VENENUX 0.8', + ); + + public static function getName($distList = '') + { + $returnString = null; + $returnArray = array(); + $distArray = explode(',',$distList); + foreach ($distArray as $dist) + { + $dist = trim($dist); + if (array_key_exists($dist,self::$allowed)) + { + $returnArray[] = self::$allowed[$dist]; + } + } + return implode("
",$returnArray); + } + + public static function check($distString) + { + $distArray = explode(',',$distString); + + $allowedArray = array_keys(self::$allowed); + + foreach ($distArray as $dist) + { + $dist = trim($dist); + if (!in_array($dist,$allowedArray)) return false; + } + + return true; + } + + public static function getFormHtml() + { + $str = "
"; + $str .= "
"; + foreach (self::$allowed as $value => $label) + { + $str .= "
$label
"; + } + $str .= "
"; + $str .= ""; + $str .= ""; + $str .= "
"; + + return $str; + } + +} \ No newline at end of file diff --git a/h-source/Application/Include/hardware.php b/h-source/Application/Include/hardware.php new file mode 100644 index 0000000..e711231 --- /dev/null +++ b/h-source/Application/Include/hardware.php @@ -0,0 +1,216 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + + +class Hardware +{ + + public static $controllers = array('notebooks','wifi','videocards','printers','scanners'); //used by UsersController::login() + + public static $commYear = 'not-specified,2010,2009,2008,2007,2006,2005,2004,2003,2002,2001,2000,1999,1998,1997,1996,1995,1994,1993,1992'; + +} + +class Printer extends hardware +{ + public static $vendors = array( + "brother" => "brother", + "Canon" => "Canon", + "EPSON" => "EPSON", + "Lexmark" => "Lexmark", + "KONICA-MINOLTA" => "KONICA-MINOLTA", + "Hewlett-Packard" => "Hewlett-Packard", + "Panasonic" => "Panasonic", + "RICOH" => "RICOH", + "SAMSUNG" => "SAMSUNG", + "SHARP" => "SHARP", + "TOSHIBA" => "TOSHIBA", + "XEROX" => "XEROX", + ); + + public static $compatibility = array( + "A Full" => "A-Full", + "B Partial" => "B-Partial", + "C None" => "C-None", + ); + + public static $interface = "not-specified,USB,Serial,Parallel,Firewire,SCSI,Ethernet"; + + public static function vendorsList() + { + return implode(',',array_values(self::$vendors)); + } + + public static function compatibilityList() + { + return implode(',',array_values(self::$compatibility)); + } + +} + +class Wifi extends hardware +{ + public static $vendors = array( + "A-LINK" => "A-LINK", + "Airlink101" => "Airlink101", + "Belkin" => "Belkin", + "Broadcom" => "Broadcom", + "CANYON" => "CANYON", + "D-Link" => "D-Link", + "Hawking" => "Hawking", + "Intel" => "Intel", + "LevelOne" => "LevelOne", + "Linksys" => "Linksys", + "NEC" => "NEC", + "Netgear" => "Netgear", + "Ralink" => "Ralink", + "TOSHIBA" => "TOSHIBA", + "TP-LINK" => "TP-LINK", + ); + + public static $interface = "not-specified,USB,PCI,PCI-E,mini-PCI,mini-PCI-E,ExpressCard,PC-Card"; + + public static $wifiSelect = 'yes,no'; + + public static function vendorsList() + { + return implode(',',array_values(self::$vendors)); + } +} + +class Videocard extends hardware +{ + public static $vendors = array( + "ATI" => "ATI", + "NVIDIA" => "NVIDIA", + "Intel" => "Intel", + ); + + public static $videoSelect = array( + "works with 3D acceleration" => "works_with_3D", + "works, but without 3D acceleration" => "works_without_3D", + ); + + public static $videoReverse = array( + "works_with_3D" => "works with 3D acceleration", + "works_without_3D" => "works, but without 3D acceleration", + ); + + public static $interface = "not-specified,PCI,AGP,PCI-E,ISA"; + + public static function vendorsList() + { + return implode(',',array_values(self::$vendors)); + } + + public static function videoList() + { + return implode(',',array_values(self::$videoSelect)); + } +} + + +class Notebooks extends Hardware +{ + + public static $vendors = array( + "Acer" => "Acer", + "Apple" => "Apple", + "Asus" => "Asus", + "Compal Electronics" => "Compal-Electronics", + "COMPAQ" => "COMPAQ", + "Dell" => "Dell", + "emachines" => "emachines", + "FUJITSU" => "FUJITSU", + "Gateway" => "Gateway", + "Hewlett Packard" => "Hewlett-Packard", + "IBM" => "IBM", + "Lenovo" => "Lenovo", + "LG" => "LG", + "Philco" => "Philco", + "Philips" => "Philips", + "Panasonic" => "Panasonic", + "Sony" => "Sony", + "SAMSUNG" => "SAMSUNG", + "Thomson" => "Thomson", + "TOSHIBA" => "TOSHIBA", + ); + + public static $compatibility = array( + "A Platinum" => "A-platinum", + "B Gold" => "B-gold", + "C Silver" => "C-silver", + "D Bronze" => "D-bronze", + "E Garbage" => "E-garbage" + ); + + public static $subtypeSelect = 'notebook,netbook,not-specified'; + + public static $videoSelect = array( + "not specified" => 'not-specified', + "yes, with 3D acceleration" => "yes_with_3D", + "yes, but without 3D acceleration" => "yes_without_3D", + "it does not work" => "no", + ); + + public static $videoReverse = array( + "yes_with_3D" => "works with 3D acceleration", + "yes_without_3D" => "works but without 3D acceleration", + "no" => "it does not work", + 'not-specified' => "not specified how it works", + "" => "" + ); + + public static $wifiSelect = array( + "not specified" => 'not-specified', + 'yes' => 'yes', + 'no' => 'no', + 'there is no wifi card' => 'no-wifi-card', + ); + + public static $wifiReverse = array( + "yes" => "it works", + "no" => "it does not work", + 'not-specified' => "not specified how it works", + 'no-wifi-card' => 'there is no wifi card', + "" => "" + ); + + public static function videoList() + { + return implode(',',array_values(self::$videoSelect)); + } + + public static function wifiList() + { + return implode(',',array_values(self::$wifiSelect)); + } + + public static function vendorsList() + { + return implode(',',array_values(self::$vendors)); + } + + public static function compatibilityList() + { + return implode(',',array_values(self::$compatibility)); + } + +} \ No newline at end of file diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php new file mode 100644 index 0000000..8351a88 --- /dev/null +++ b/h-source/Application/Include/languages.php @@ -0,0 +1,322 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class Lang +{ + public static $allowed = array('en','es','fr','it'); + public static $current = 'en'; + + public static $complete = array( + 'en' => 'gb.png,English', + 'es' => 'es.png,Español', + 'fr' => 'fr.png,Français', + 'it' => 'it.png,Italiano', + ); + + public static $i18n = array( + 'it' => array + ( + "List of issues" => "Lista di questioni", + "TITLE" => "TITOLO", + "TOPIC" => "ARGOMENTO", + "OPENED BY" => "APERTO DA", + "DATE" => "DATA", + "REPLIES" => "MESSAGGI", + "PRIORITY" => "PRIORITÀ", + "STATUS" => "STATO", + "You have to" => "Devi eseguire il", + "in order to submit an issue" => "per poter aprire una nuova questione", + "Description" => "Descrizione", + "Messages" => "Messaggi", + "this message has been deleted" => "questo messaggio è stato cancellato", + "in order to submit a message to this issue" => "per aggiungere un messaggio a questa questione", + "model name" => "nome del modello", + "model type" => "tipo di device", + "year of commercialization" => "anno di commercializzazione", + "Results of the search" => "Risultati della ricerca", + "page list" => "pagine", + "No devices found" => "Non è stato trovato alcun device", + "vendor" => "marca", + "compatibility" => "compatibilità", + "year" => "anno", + "subtype" => "sottotipo", + "sort by" => "ordina per", + "interface" => "interfaccia", + "does it work?" => "funziona?", + "preview of the message" => "anteprima del messaggio", + "preview of the new issue message" => "anteprima del testo della questione", + "Add a message to this issue" => "Aggiungi un messaggio a questa questione", + "Add a new issue" => "Aggiungi una nuova questione", + "MESSAGE" => "MESSAGGIO", + "there are no messages" => "non ci sono messaggi", + "No notebooks found" => "Non è stato trovato alcun notebook", + "subtype (notebook or netbook)" => "sottotipo (notebook or netbook)", + "compatibility with free software" => "compatibilità con il software libero", + "view the other specifications" => "guarda le altre specifiche", + "model" => "modello", + "model id" => "id del modello", + "tested on" => "testato con", + "tested with the following kernel libre" => "testato con il seguente kernel libre", + "video card model" => "modello di scheda video", + "wifi model" => "modello di scheda wifi", + "GNU/Linux distribution used for the test" => "distribuzione GNU/Linux usata per il test", + "does the video card work?" => "funziona la scheda video?", + "does the wifi card work?" => "funziona la scheda wifi?", + "Description: (write here all the useful information)" => "Descrizione (scrivi sotto tutte le informazioni utili)", + "discover all the wiki tags" => "scopri tutti i tag della wiki", + "Fields marked with * are mandatory" => "I campi marcati con * sono obbligatori", + "No printers found" => "Non è stata trovata alcuna stampante", + "interface" => "interfaccia", + "VendorID:ProductID code of the device" => "codice VendorID:ProductID del prodotto", + "free driver used" => "driver liberi usati", + "set not-specified if not sure" => "seleziona not-specified se non sei sicuro/a", + "see the help page or leave blank if you are not sure" => "guarda nella pagina di help o lascia vuoto se non sei sicuro/a", + "No scanners found" => "Non sono è stato trovato alcuno scanner", + "No video cards found" => "Non è stata trovata alcuna scheda grafica", + "how does it work with free software?" => "come funziona con il software libero?", + "No wifi cards found" => "Non è stata trovata alcuna scheda wifi", + "does it work with free software?" => "funziona con il software libero?", + "differences in the entry" => "differenze nel campo", + ), + 'es' => array + ( + "List of issues" => "Lista de incidencias", + "TITLE" => "TITULO", + "TOPIC" => "ARGUMENTO", + "OPENED BY" => "ABIERTO POR", + "DATE" => "FECHA", + "REPLIES" => "RESPUESTAS", + "PRIORITY" => "PRIORIDAD", + "STATUS" => "ESTADO", + "You have to" => "Tiene que", + "in order to submit an issue" => "para poder agregar una incidencia", + "Description" => "Descripción", + "Messages" => "Mensajes", + "this message has been deleted" => "este mensaje ha sido borrado", + "in order to submit a message to this issue" => "para poder agregar un mensaje a esta incidencia", + "model name" => "nombre del modelo", + "model type" => "tipo de modelo", + "year of commercialization" => "año de comercialización", + "Results of the search" => "Resultado de la búsqueda", + "page list" => "página", + "No devices found" => "No se encontró ningún dispositivo", + "vendor" => "fabricante", + "compatibility" => "compatibilidad", + "year" => "año", + "subtype" => "subtipo", + "sort by" => "ordenar por", + "interface" => "interfaz", + "does it work?" => "¿funciona?", + "preview of the message" => "vista previa del mensaje", + "preview of the new issue message" => "vista previa del mensaje de la incidencia", + "Add a message to this issue" => "Agregue un mensaje a esta incidencia", + "Add a new issue" => "Agregue una nueva incidencia", + "MESSAGE" => "MENSAJE", + "there are no messages" => "no hay mensajes", + "No notebooks found" => "No se encontró ninguna laptop", + "subtype (notebook or netbook)" => "subtipo (laptop o netbook)", + "compatibility with free software" => "compatibilidad con software libre", + "view the other specifications" => "ver otras especificaciones", + "model" => "modelo", + "model id" => "id del modelo", + "tested on" => "probado con", + "tested with the following kernel libre" => "probado con el siguiente kernel libre", + "video card model" => "modelo de tarjeta de video", + "wifi model" => "modelo de tarjeta de red inalámbrica", + "GNU/Linux distribution used for the test" => "distribución GNU/Linux usada para la prueba", + "does the video card work?" => "¿funciona la tarjeta de video?", + "does the wifi card work?" => "¿funciona la tarjeta de red inalámbrica?", + "Description: (write here all the useful information)" => "Descripción (escriba aquí toda la información útil)", + "discover all the wiki tags" => "mostrar todas las etiquetas del wiki", + "Fields marked with * are mandatory" => "Campos marcados con * son obligatorios", + "No printers found" => "No se encontró ninguna impresora", + "interface" => "interfaz", + "VendorID:ProductID code of the device" => "código VendorID:ProductID del dispositivo", + "free driver used" => "driver libre usado", + "set not-specified if not sure" => "seleccione not-specified si no esta seguro/a", + "see the help page or leave blank if you are not sure" => "vea la página de ayuda o deje vacío si no esta seguro/a", + "No scanners found" => "No se encontró ningun escáner", + "No video cards found" => "No se encontró ninguna tarjeta de video", + "how does it work with free software?" => "¿como funciona con software libre?", + "No wifi cards found" => "No se encontró ninguna tarjeta de red inalámbrica", + "does it work with free software?" => "¿funciona con software libre?", + "differences in the entry" => "diferencias en el campo", + ), + ); + + public static function sanitize($lang = 'en') + { + return (in_array($lang,self::$allowed)) ? sanitizeAll($lang) : 'en'; + } +} + +class MyStrings +{ + + public static $view = array( + + 'en' => array( + + 'notebooks' => array( + + 'element' => 'notebook' + + ), + + 'wifi' => array( + + 'element' => 'wifi card' + + ), + + 'videocards'=> array( + + 'element' => 'video card' + + ), + + 'printers'=> array( + + 'element' => 'printer' + + ), + + 'scanners'=> array( + + 'element' => 'scanner' + + ), + ), + + 'fr' => array( + + 'notebooks' => array( + + 'element' => 'notebook' + + ), + + 'wifi' => array( + + 'element' => 'wifi card' + + ), + + 'videocards'=> array( + + 'element' => 'video card' + + ), + + 'printers'=> array( + + 'element' => 'printer' + + ), + + 'scanners'=> array( + + 'element' => 'scanner' + + ), + ), + + 'it' => array( + + 'notebooks' => array( + + 'element' => 'notebook' + + ), + + 'wifi' => array( + + 'element' => 'wifi card' + + ), + + 'videocards'=> array( + + 'element' => 'video card' + + ), + + 'printers'=> array( + + 'element' => 'printer' + + ), + + 'scanners'=> array( + + 'element' => 'scanner' + + ), + ), + + 'es' => array( + + 'notebooks' => array( + + 'element' => 'notebook' + + ), + + 'wifi' => array( + + 'element' => 'wifi card' + + ), + + 'videocards'=> array( + + 'element' => 'video card' + + ), + + 'printers'=> array( + + 'element' => 'printer' + + ), + + 'scanners'=> array( + + 'element' => 'scanner' + + ), + ), + ); + + //type => controller + public static $reverse = array( + 'notebook' => 'notebooks', + 'wifi' => 'wifi', + 'videocard' => 'videocards', + 'printer' => 'printers', + 'scanner' => 'scanners', + ); + + public static function getTypes() + { + return implode(',',array_keys(self::$reverse)); + } + +} \ No newline at end of file diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php new file mode 100644 index 0000000..a5e3934 --- /dev/null +++ b/h-source/Application/Include/myFunctions.php @@ -0,0 +1,330 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +function encodeUrl($url) +{ + $url = str_replace(' ','-',$url); + $url = str_replace('[',null,$url); + $url = str_replace(']',null,$url); + $url = str_replace('(',null,$url); + $url = str_replace(')',null,$url); + $url = urlencode($url); +// $url = html_entity_decode($url, ENT_QUOTES); +// $url = xml_encode($url); + return $url; +} + + +function smartDate($uglyDate = null, $lang = 'en') +{ + switch ($lang) + { + case 'en': + $smDate = date('H:i, d F Y',strtotime($uglyDate)); + break; + default: + $smDate = date('H:i, d F Y',strtotime($uglyDate)); + } + return $smDate; +} + +function sanitizeString($string) +{ + $string = preg_match('/^[a-zA-Z0-9\-\_\.\+\s]+$/',$string) ? sanitizeAll($string) : 'undef'; + return $string; +} + +function sanitizeAlphanum($string) +{ + $string = ctype_alnum($string) ? sanitizeAll($string) : 'undef'; + return $string; +} + + +function getOrderByClause($string) +{ + switch ($string) + { + case 'last-inserted': + $orderBy = 'hardware.id_hard desc'; + break; + case 'alphabetically': + $orderBy = 'model'; + break; + case 'alphabetically-desc': + $orderBy = 'model desc'; + break; + case 'compatibility': + $orderBy = 'compatibility'; + break; + case 'undef': + $orderBy = 'hardware.id_hard desc'; + break; + default: + $orderBy = 'hardware.id_hard desc'; + } + + return $orderBy; +} + + +// function isEqual($str1, $str2) +// { +// // $str1 = str_replace("\n",'',$str1); +// // $str1 = str_replace("\r",null,$str1); +// // $str2 = str_replace("\n",'',$str1); +// // $str2 = str_replace("\r",null,$str1); +// +// return (strcmp($str1,$str2) === 0) ? true : false; +// } +// +// function getNewKeys($array,$ovalue) +// { +// $res = array(); +// for ($i = 0; $i < count($array); $i++) +// { +// if (isEqual($array[$i],$ovalue)) $res[] = $i; +// // if (strcmp($keys[$i],$ovalue) === 0) $res[] = $i; +// } +// return $res; +// } + +function diff($old, $new){ + $maxlen = 0; + foreach($old as $oindex => $ovalue){ +// $nkeys = getNewKeys($new,$ovalue); + $nkeys = array_keys($new, $ovalue); + foreach($nkeys as $nindex){ + $matrix[$oindex][$nindex] = isset($matrix[$oindex - 1][$nindex - 1]) ? + $matrix[$oindex - 1][$nindex - 1] + 1 : 1; + if($matrix[$oindex][$nindex] > $maxlen){ + $maxlen = $matrix[$oindex][$nindex]; + $omax = $oindex + 1 - $maxlen; + $nmax = $nindex + 1 - $maxlen; + } + } + } + if($maxlen == 0) return array(array('d'=>$old, 'i'=>$new)); + return array_merge( + diff(array_slice($old, 0, $omax), array_slice($new, 0, $nmax)), + array_slice($new, $nmax, $maxlen), + diff(array_slice($old, $omax + $maxlen), array_slice($new, $nmax + $maxlen))); +} + +function htmlDiff($old, $new){ + $old = str_replace("\r\n"," \r\n ",$old); + $new = str_replace("\r\n"," \r\n ",$new); + + $ret = null; + $diff = diff(explode(' ', $old), explode(' ', $new)); + foreach($diff as $k){ + if(is_array($k)) + $ret .= (!empty($k['d'])?"".implode(' ',$k['d'])." ":''). + (!empty($k['i'])?"".implode(' ',$k['i'])." ":''); + else $ret .= $k . ' '; + } + return $ret; +} + + +//a cosa serve? +function applyBreaks($values,$fields) +{ + $fieldsArray = explode(',',$fields); + + foreach ($fieldsArray as $field) + { + if (array_key_exists($field,$values)) + { + $values[$field] = nl2br($values[$field]); + } + } + return $values; +} + + +function getLinkToUser($user) +{ + if (strstr($user,'__')) + { + return str_replace('__',null,$user); + } + else + { + return "$user"; + } +} + + + +//decode the text of the wiki +function decodeWikiText($string) +{ + + $string = preg_replace('/(\[hr\])/', '
',$string); + + $string = preg_replace_callback('/(\[a\])(.*?)(\[\/a\])/', 'linkTo',$string); + + $string = preg_replace_callback('/(\[a\])(.*?)\|(.*?)(\[\/a\])/', 'linkToWithText',$string); + + $string = preg_replace_callback('/(\[notebook\])([0-9]*?)(\[\/notebook\])/s', 'linkToNotebook',$string); + + $string = preg_replace_callback('/(\[wifi\])([0-9]*?)(\[\/wifi\])/s', 'linkToWifi',$string); + + $string = preg_replace_callback('/(\[videocard\])([0-9]*?)(\[\/videocard\])/s', 'linkToVideocard',$string); + + $string = preg_replace('/(\[b\])(.*?)(\[\/b\])/s', '${2}',$string); + + $string = preg_replace('/(\[u\])(.*?)(\[\/u\])/s', '${2}',$string); + + $string = preg_replace('/(\[i\])(.*?)(\[\/i\])/s', '${2}',$string); + + $string = preg_replace('/(\[del\])(.*?)(\[\/del\])/s', '${2}',$string); + + $string = preg_replace('/(\[\*\])(.*?)(\[\/\*\])/s', '
  • ${2}
  • ',$string); + + $string = preg_replace('/(\[list\])(.*?)(\[\/list\])/s', '',$string); + + $string = preg_replace('/(\[enum\])(.*?)(\[\/enum\])/s', '
      ${2}
    ',$string); + + $string = preg_replace('/(\[code\])(.*?)(\[\/code\])/s', '
    ${2}
    ',$string); + + $string = preg_replace('/(\[p\])(.*?)(\[\/p\])/s', '

    ${2}

    ',$string); + + $string = preg_replace('/(\[h1\])(.*?)(\[\/h1\])/s', '
    ${2}
    ',$string); + + $string = preg_replace('/(\[h2\])(.*?)(\[\/h2\])/s', '
    ${2}
    ',$string); + + $string = preg_replace('/(\[h3\])(.*?)(\[\/h3\])/s', '
    ${2}
    ',$string); + + return $string; +} + +function checkUrl($url) +{ +// $match = '/^http\:\/\/(www\.)?[a-zA-Z0-9\-\_]+(\.[a-zA-Z0-9\-\_]+)?\.(com|net|it|info|org|eu|uk)((\/[a-zA-Z0-9\_\-\+]+)+[\/]?)?(\?([a-zA-Z0-9\_\-\+\s]+\=[a-zA-Z0-9\_\-\s\+\&]+)+)?(#[a-zA-Z0-9\_\-\+\s]+)?([\s]*)?$/'; + + $match = '/^http\:\/\/(www\.)?[a-zA-Z0-9\-\_]+(\.[a-zA-Z0-9\-\_]+)?\.(com|net|it|info|org|eu|uk|ca)((\/[a-zA-Z0-9\_\-\+]+)*(\/([a-zA-Z0-9\_\-\.\+]+\.(php|html|htm|asp|aspx|jsp|cgi))?)?)?(\?([a-zA-Z0-9\_\-\+\s]+\=[a-zA-Z0-9\_\-\s\+\&]+)+)?(#[a-zA-Z0-9\_\-\+\s]+)?([\s]*)?$/'; + + if (preg_match($match,$url)) + { + return true; + } + else + { + return false; + } +} + +function vitalizeUrl($string) +{ + if (checkUrl($string)) + { + return "".$string.""; + } + return $string; +} + +function linkTo($match) +{ + if (checkUrl($match[2])) + { + return "".$match[2].""; + } + else + { + return $match[0]; + } +} + +function linkToWithText($match) +{ + if (checkUrl($match[2])) + { + + return "".$match[3].""; + } + else + { + return $match[0]; + } +} + +//create the link to the wiki page of the notebook +function linkToNotebook($match) +{ + $hardware = new HardwareModel(); + $clean['id_hard'] = (int)$match[2]; + $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); + $href = "HTTP://".DOMAIN_NAME."/notebooks/view/".Lang::$current."/".$clean['id_hard']."/$name"; + return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; +} + +//create the link to the wiki page of the wifi +function linkToWifi($match) +{ + $hardware = new HardwareModel(); + $clean['id_hard'] = (int)$match[2]; + $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); + $href = "HTTP://".DOMAIN_NAME."/wifi/view/".Lang::$current."/".$clean['id_hard']."/$name"; + return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; +} + +//create the link to the wiki page of the videocard +function linkToVideocard($match) +{ + $hardware = new HardwareModel(); + $clean['id_hard'] = (int)$match[2]; + $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); + $href = "HTTP://".DOMAIN_NAME."/videocards/view/".Lang::$current."/".$clean['id_hard']."/$name"; + return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; +} + +function getUserName($id_user = 0) +{ + $clean['id_user'] = (int)$id_user; + $u = new UsersModel(); + return $u->getUser($clean['id_user']); +} + +function getMotivation($row,$controller) +{ + if (strcmp($row['deletion']['object'],'duplication') === 0) + { + $clean['id_hard'] = (int)$row['deletion']['id_duplicate']; + $hardware = new HardwareModel(); + $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); + return "duplication of the model having id ".$clean['id_hard'].""; + } + else + { + return "".$row['deletion']['object'].""; + } +} + +//get the text in the right language +function gtext($string) +{ + if (isset(Lang::$i18n[Lang::$current][$string])) + { + return Lang::$i18n[Lang::$current][$string]; + } + return $string; +} \ No newline at end of file diff --git a/h-source/Application/Include/params.php b/h-source/Application/Include/params.php new file mode 100644 index 0000000..d53960b --- /dev/null +++ b/h-source/Application/Include/params.php @@ -0,0 +1,143 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class Website +{ + static public $generalMail = ""; + + static public $generalName = "h-node.com"; + + static public $projectName = "h-node"; + + static public $mailServer = ""; + + static public $mailPassword = ""; +} + +class Account +{ + + static public $confirmTime = 3600; + + static public function confirm($username,$e_mail,$id_user,$token) + { + require_once (ROOT.'/External/swiftmailer/lib/swift_required.php'); + + $clean['username'] = sanitizeAll($username); + $clean['id_user'] = (int)$id_user; + $clean['token'] = sanitizeAll($token); + + $siteName = Website::$generalName; + $siteMail = Website::$generalMail; + + $mess = "Hello,\n\nyou have registered an account at $siteName with the following data:\nusername: ".$clean['username']."\n\nin order to confirm the registration of the new account follow the link below\nhttp://".DOMAIN_NAME."/users/confirm/".Lang::$current."/".$clean['id_user']."/".$clean['token']."\n\nIf you don't want to confirm the account registration\nthen wait one hour and your username and e-mail will be deleted from the database\n\nIf you received this e-mail for error, please simply disregard this message"; + + $message = Swift_Message::newInstance()->setSubject('account registration to '.$siteName)->setFrom(array($siteMail => $siteName))->setTo(array($e_mail))->setBody($mess); + + //Create the Transport + $transport = Swift_SmtpTransport::newInstance(Website::$mailServer, 25)->setUsername(Website::$generalMail)->setPassword(Website::$mailPassword); + + //Create the Mailer using your created Transport + $mailer = Swift_Mailer::newInstance($transport); + + //Send the message + $result = $mailer->send($message); + + if ($result) + { + return true; + } + else + { + return false; + } + + } + + static public function sendnew($username,$e_mail,$id_user,$token) + { + require_once (ROOT.'/External/swiftmailer/lib/swift_required.php'); + + $clean['username'] = sanitizeAll($username); + $clean['id_user'] = (int)$id_user; + $clean['token'] = sanitizeAll($token); + + $siteName = Website::$generalName; + $siteMail = Website::$generalMail; + + $mess = "Hello,\n\nyou have requested a new password for your account at $siteName.\nYour username is:\n".$clean['username']."\n\nin order to obtain a new password for your account follow the link below\nhttp://".DOMAIN_NAME."/users/change/".Lang::$current."/".$clean['id_user']."/".$clean['token']."\n\nIf you don't want to change the password then disregard this mail\n"; + + $message = Swift_Message::newInstance()->setSubject('request a new password at '.$siteName)->setFrom(array($siteMail => $siteName))->setTo(array($e_mail))->setBody($mess); + + //Create the Transport + $transport = Swift_SmtpTransport::newInstance(Website::$mailServer, 25)->setUsername(Website::$generalMail)->setPassword(Website::$mailPassword); + + //Create the Mailer using your created Transport + $mailer = Swift_Mailer::newInstance($transport); + + //Send the message + $result = $mailer->send($message); + + if ($result) + { + return true; + } + else + { + return false; + } + + } + + static public function sendpassword($username,$e_mail,$password) + { + require_once (ROOT.'/External/swiftmailer/lib/swift_required.php'); + + $clean['username'] = sanitizeAll($username); + $clean['password'] = sanitizeAll($password); + + $siteName = Website::$generalName; + $siteMail = Website::$generalMail; + + $mess = "Hello,\n\nyou have requested a new password for your account to $siteName.\nYour username is:\n".$clean['username']."\n\nYour new password is:\n".$clean['password']."\n"; + + $message = Swift_Message::newInstance()->setSubject('get your new h-node.com account password ')->setFrom(array($siteMail => $siteName))->setTo(array($e_mail))->setBody($mess); + + //Create the Transport + $transport = Swift_SmtpTransport::newInstance(Website::$mailServer, 25)->setUsername(Website::$generalMail)->setPassword(Website::$mailPassword); + + //Create the Mailer using your created Transport + $mailer = Swift_Mailer::newInstance($transport); + + //Send the message + $result = $mailer->send($message); + + if ($result) + { + return true; + } + else + { + return false; + } + + } + +} \ No newline at end of file diff --git a/h-source/Application/Models/BaseModel.php b/h-source/Application/Models/BaseModel.php new file mode 100644 index 0000000..b40482e --- /dev/null +++ b/h-source/Application/Models/BaseModel.php @@ -0,0 +1,66 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class BaseModel extends Model_Tree { + + public $type = ''; //device type + public $diffFields = array(); + + public function __construct() { + $this->_tables = 'hardware'; + $this->_idFields = 'id_hard'; + + $this->_where=array( + 'type' => 'hardware', + 'vendor' => 'hardware', + 'compatibility' => 'hardware', + 'comm_year' => 'hardware', + ); + + $this->orderBy = 'hardware.id_hard desc'; + parent::__construct(); + } + + public function checkType($id_hard = 0) + { + $clean['id_hard'] = (int)$id_hard; + $res = $this->db->select('hardware','type','id_hard='.$clean['id_hard']); + if (count($res) > 0) + { + return (strcmp($this->type,$res[0]['hardware']['type']) === 0 ) ? true : false; + } + return false; + } + + public function getDiffArray($oldArray, $newArray) + { + $diffArray = array(); + foreach ($this->diffFields as $field => $label) + { + if (array_key_exists($field,$oldArray) and array_key_exists($field,$newArray)) + { +// echo htmlDiff($oldArray[$field], $newArray[$field]); +// echo $oldArray[$field].$newArray[$field]; + $diffArray[$label] = htmlDiff($oldArray[$field], $newArray[$field]); + } + } + return $diffArray; + } +} \ No newline at end of file diff --git a/h-source/Application/Models/BoxesModel.php b/h-source/Application/Models/BoxesModel.php new file mode 100644 index 0000000..0e6eee1 --- /dev/null +++ b/h-source/Application/Models/BoxesModel.php @@ -0,0 +1,40 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class BoxesModel extends Model_Tree { + + public function __construct() { + $this->_tables = 'boxes'; + $this->_idFields = 'id_box'; + + parent::__construct(); + } + + public $formStruct = array( + 'entries' => array( + 'title' => array(), + 'message' => array('type'=>'Textarea'), + 'id_box' => array( + 'type' => 'Hidden' + ) + ), + ); + +} \ No newline at end of file diff --git a/h-source/Application/Models/DeletionModel.php b/h-source/Application/Models/DeletionModel.php new file mode 100644 index 0000000..ea3c4e6 --- /dev/null +++ b/h-source/Application/Models/DeletionModel.php @@ -0,0 +1,51 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class DeletionModel extends Model_Tree +{ + + public function __construct() + { + $this->_tables = 'deletion'; + $this->_idFields = 'id_del'; + +// $this->_where=array( +// 'id_hard' => 'talk' +// ); +// + $this->_popupItemNames = array( + 'object' => 'object', + ); + + $this->_popupLabels = array( + 'object' => 'OBJECT', + ); +// + $this->orderBy = 'deletion.id_del desc'; + + $this->strongConditions['insert'] = array( + "checkIsStrings|duplication,other" => 'object', + "+checkLength|500" => 'message' + ); + + parent::__construct(); + } + +} \ No newline at end of file diff --git a/h-source/Application/Models/HardwareModel.php b/h-source/Application/Models/HardwareModel.php new file mode 100644 index 0000000..710ddaf --- /dev/null +++ b/h-source/Application/Models/HardwareModel.php @@ -0,0 +1,198 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class HardwareModel extends Model_Map { + + public $id_user = 0; + public $type = ''; //device type + public $lastId = 0; //the id of the last record inserted + + public $formStruct = array( + 'entries' => array( + 'deleted'=> array('type'=>'Select','options'=>'no,yes'), + 'id_hard' => array( + 'type' => 'Hidden' + ) + ), + ); + + public function __construct() { + $this->_tables='hardware,regusers,hardware_users'; + $this->_idFields='id_hard,id_user'; + $this->_where=array( + 'type' => 'hardware', + 'username' => 'regusers', + 'has_confirmed' => 'regusers', + 'deleted' => 'regusers', + '-deleted' => 'hardware' + ); + $this->orderBy = 'hardware.id_hard desc'; + $this->printAssError = "no"; + + $this->_popupItemNames = array( + 'type'=>'type', + 'ask_for_del'=>'ask_for_del', + '-deleted'=>'deleted', + ); + + $this->_popupLabels = array( + 'type'=>'TYPE', + 'ask_for_del'=>'ASK FOR DEL?', + '-deleted'=>'DELETED?', + ); + + $this->databaseConditions['insert'] = array( + 'checkUnique' => 'model', + ); + + $this->databaseConditions['update'] = array( + 'checkUniqueCompl' => 'model', + ); + + parent::__construct(); + } + + public function insert() + { + $this->values['created_by'] = (int)$this->id_user; + $this->values['updated_by'] = (int)$this->id_user; + $this->values['update_date'] = date('Y-m-d H:i:s'); + + //random ID + $randomId = md5(uniqid(mt_rand(),true)); + $this->values["type"] = $randomId; + + parent::insert(); + + //associate the user to the record + if ($this->queryResult) + { + $resId = $this->db->select("hardware","id_hard","type='$randomId'"); + $clean['id'] = $resId[0]['hardware']['id_hard']; + $this->lastId = $clean['id']; + $this->db->update('hardware','type',array($this->type),'id_hard='.$clean['id']); + + $this->associate($clean['id']); + } + + } + + public function update($id) + { + $clean['id'] = (int)$id; + + $this->values['updated_by'] = (int)$this->id_user; + $this->values['update_date'] = date('Y-m-d H:i:s'); + + //save the old fields in the revisions table + $this->setWhereQueryClause(array('id_hard' => $clean['id'])); + $oldStruct = $this->getFields($this->fields.',created_by,updated_by,update_date,type,id_hard'); + + if (count($oldStruct > 0)) + { + if (strcmp($oldStruct[0]['hardware']['type'],$this->type) === 0) + { + $oldValues = $oldStruct[0]['hardware']; + + $revisions = new RevisionsModel(); + $revisions->values = $oldValues; + if ($revisions->insert()) + { + parent::update($clean['id']); + if ($this->queryResult) + { + $this->lastId = $clean['id']; + if (!$this->checkAssociation($clean['id'],(int)$this->id_user)) + { + $this->associate($clean['id']); + } + } + } + } + } + } + + public function makeCurrent($id_rev) + { + $clean['id_rev'] = (int)$id_rev; + + $revisions = new RevisionsModel(); + + $clean['id_hard'] = (int)$revisions->getIdHard($clean['id_rev']); + + //save the old fields in the revisions table + $this->setWhereQueryClause(array('id_hard'=>$clean['id_hard'])); + $oldStruct = $this->getFields($this->fields.',created_by,updated_by,update_date,type,id_hard'); + + if (count($oldStruct > 0)) + { + if (strcmp($oldStruct[0]['hardware']['type'],$this->type) === 0) + { + //get the values of the revision + $revisions->setWhereQueryClause(array('id_rev'=>$clean['id_rev'])); + $newStruct = $revisions->getFields($this->fields.',created_by,updated_by,update_date,type,id_hard'); + + if (count($newStruct > 0)) + { + $revisions->values = $oldStruct[0]['hardware']; + + $this->values = $newStruct[0]['revisions']; + $this->values['updated_by'] = (int)$this->id_user; + $this->values['update_date'] = date('Y-m-d H:i:s'); + + if ($revisions->insert()) + { + if (parent::update($clean['id_hard'])) + { + $this->lastId = $clean['id_hard']; + if (!$this->checkAssociation($clean['id_hard'],(int)$this->id_user)) + { + $this->associate($clean['id_hard']); + } + } + } + } + } + else + { + $this->notice = "
    Wrong type..
    \n"; + } + } + + } + + public function associate($id_record) + { + return parent::associate((int)$id_record,(int)$this->id_user); + } + + //get the model name + public function getTheModelName($id) + { + $clean['id'] = (int)$id; + $this->setWhereQueryClause(array('id_hard' => $clean['id'])); + $res = $this->getFields('model'); + $name = count($res) > 0 ? $res[0]['hardware']['model'] : ''; + return $name; + } + + + +} \ No newline at end of file diff --git a/h-source/Application/Models/HistoryModel.php b/h-source/Application/Models/HistoryModel.php new file mode 100644 index 0000000..309bc99 --- /dev/null +++ b/h-source/Application/Models/HistoryModel.php @@ -0,0 +1,48 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class HistoryModel extends Model_Tree { + + public function __construct() { + $this->_tables = 'history'; + $this->_idFields = 'id_history'; + + $this->orderBy = 'history.id_history'; + + $this->_popupFunctions = array( + 'created_by'=> 'getUserName', + ); + + $this->_popupItemNames = array( + 'type' => 'type', + 'action' => 'action', + 'created_by'=> 'created_by', + ); + + $this->_popupLabels = array( + 'type' => 'TYPE', + 'action' => 'ACTION', + 'created_by'=> 'MODERATOR', + ); + + parent::__construct(); + } + +} \ No newline at end of file diff --git a/h-source/Application/Models/IssuesModel.php b/h-source/Application/Models/IssuesModel.php new file mode 100644 index 0000000..8ca8a52 --- /dev/null +++ b/h-source/Application/Models/IssuesModel.php @@ -0,0 +1,131 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class IssuesModel extends Model_Tree { + + public function __construct() { + $this->_tables = 'issues'; + $this->_idFields = 'id_issue'; + + $this->_onDelete = 'nocheck'; + + $this->_where = array( + 'priority' => 'issues', + 'status' => 'issues', + 'topic' => 'issues', + ); + + $this->_popupItemNames = array( + 'priority' => 'priority', + 'status' => 'status', + 'topic' => 'topic', + 'deleted' => 'deleted', + ); + + $this->_popupLabels = array( + 'priority' => 'PRIORITY', + 'status' => 'STATUS', + 'topic' => 'TOPIC', + 'deleted' => 'DELETED?', + ); + + $this->orderBy = 'issues.id_issue desc'; + + $this->strongConditions['insert'] = array( + "checkLength|99" => 'title', + "+checkLength|34" => 'topic', + "++checkLength|15" => 'priority', + "+++checkLength|5000" => 'message', + "checkisStrings|low,medium,high" => 'priority', + "+checkisStrings|maybe-a-bug,new-categories-of-hardware,add-a-vendor-name,other" => 'topic', + ); + + $this->formStruct = array( + 'entries' => array( + 'title' => array('labelString' => gtext("TITLE").':'), + 'topic' => array( + 'type'=>'Select', + 'options'=>array( + 'Add a vendor name' => 'add-a-vendor-name', + 'Maybe a bug' => 'maybe-a-bug', + 'Add new categories of hardware' => 'new-categories-of-hardware', + 'Other' => 'other' + ), + 'labelString' => gtext("TOPIC").':', + ), + 'deleted'=> array( + 'type' => 'Select', + 'options' => 'no,yes', + ), + 'priority' => array( + 'type'=>'Select', + 'options'=>'low,medium,high', + 'labelString' => gtext("PRIORITY").':', + ), + 'message' => array('type'=>'Textarea','idName'=>'bb_code','labelString' => gtext("MESSAGE").':',), + 'status' => array( + 'type' => 'Select', + 'options' => 'opened,closed' + ), + 'notice' => array( + 'type' => 'Textarea', + 'idName' => 'bb_code_notice', + ), + 'id_issue' => array( + 'type' => 'Hidden' + ) + ), + ); + + parent::__construct(); + } + +// public $formStruct = array( +// 'entries' => array( +// 'title' => array(), +// 'topic' => array( +// 'type'=>'Select', +// 'options'=>array( +// 'Add a vendor name' => 'add-a-vendor-name', +// 'Maybe a bug' => 'maybe-a-bug', +// 'Add new categories of hardware' => 'new-categories-of-hardware', +// 'Other' => 'other' +// ), +// ), +// 'deleted'=> array( +// 'type' => 'Select', +// 'options' => 'no,yes', +// ), +// 'priority' => array('type'=>'Select','options'=>'low,medium,high'), +// 'message' => array('type'=>'Textarea','idName'=>'bb_code'), +// 'status' => array( +// 'type' => 'Select', +// 'options' => 'opened,closed' +// ), +// 'notice' => array( +// 'type' => 'Textarea', +// 'idName' => 'bb_code_notice', +// ), +// 'id_issue' => array( +// 'type' => 'Hidden' +// ) +// ), +// ); +} \ No newline at end of file diff --git a/h-source/Application/Models/MessagesModel.php b/h-source/Application/Models/MessagesModel.php new file mode 100644 index 0000000..64b2bed --- /dev/null +++ b/h-source/Application/Models/MessagesModel.php @@ -0,0 +1,56 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class MessagesModel extends Model_Tree { + + public function __construct() { + $this->_tables = 'messages'; + $this->_idFields = 'id_mes'; + + $this->orderBy = 'messages.id_mes'; + + $this->_popupItemNames = array( + 'deleted' => 'deleted', + 'has_read' => 'has_read', + ); + + $this->_popupLabels = array( + 'deleted' => 'DELETED?', + 'has_read' => 'ALREADY READ?', + ); + + $this->strongConditions['insert'] = array( + "checkLength|5000" => 'message', + ); + + parent::__construct(); + } + + public $formStruct = array( + 'entries' => array( + 'deleted' => array('type'=>'Select','options'=>'no,yes'), + 'has_read' => array('type'=>'Select','options'=>'no,yes'), + 'message' => array('type'=>'Textarea','idName'=>'bb_code'), + 'id_mes' => array( + 'type' => 'Hidden' + ) + ), + ); +} \ No newline at end of file diff --git a/h-source/Application/Models/NewsModel.php b/h-source/Application/Models/NewsModel.php new file mode 100644 index 0000000..fae053b --- /dev/null +++ b/h-source/Application/Models/NewsModel.php @@ -0,0 +1,42 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class NewsModel extends Model_Tree { + + public function __construct() { + $this->_tables = 'news'; + $this->_idFields = 'id_news'; + + $this->orderBy = 'news.id_news desc'; + + parent::__construct(); + } + + public $formStruct = array( + 'entries' => array( + 'title' => array(), + 'message' => array('type'=>'Textarea','idName'=>'bb_code'), + 'id_news' => array( + 'type' => 'Hidden' + ) + ), + ); + +} \ No newline at end of file diff --git a/h-source/Application/Models/NotebooksModel.php b/h-source/Application/Models/NotebooksModel.php new file mode 100644 index 0000000..456f75f --- /dev/null +++ b/h-source/Application/Models/NotebooksModel.php @@ -0,0 +1,69 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class NotebooksModel extends BaseModel { + + public $type = 'notebook'; //device type + + public function __construct() + { + + $this->_popupItemNames = array( + 'vendor' => 'vendor', + 'compatibility' => 'compatibility', + 'comm_year' => 'comm_year', + 'subtype' => 'subtype', + ); + + $this->_popupLabels = array( + 'vendor' => gtext("vendor"), + 'compatibility' => gtext("compatibility"), + 'comm_year' => gtext("year"), + 'subtype' => gtext("subtype"), + ); + + $this->_popupWhere = array( + 'vendor' => 'type="notebook" and deleted="no"', + 'compatibility' => 'type="notebook" and deleted="no"', + 'comm_year' => 'type="notebook" and deleted="no"', + 'subtype' => 'type="notebook" and deleted="no"', + ); + + $this->diffFields = array( + 'vendor' => gtext("vendor"), + 'model' => gtext('model name'), + 'subtype' => gtext('subtype (notebook or netbook)'), + 'comm_year' => gtext('year of commercialization'), + 'distribution' => gtext('GNU/Linux distribution used for the test'), + 'compatibility' => gtext('compatibility with free software'), + 'kernel' => gtext('tested with the following kernel libre'), + 'video_card_type' => gtext('video card model'), + 'video_card_works' => gtext('does the video card work?'), + 'wifi_type' => gtext('wifi model'), + 'wifi_works' => gtext('does the wifi card work?'), + 'description' => gtext('Description'), + ); + + $this->fieldsWithBreaks = array(gtext('Description')); + + parent::__construct(); + } + +} \ No newline at end of file diff --git a/h-source/Application/Models/ParamsModel.php b/h-source/Application/Models/ParamsModel.php new file mode 100644 index 0000000..d1347fe --- /dev/null +++ b/h-source/Application/Models/ParamsModel.php @@ -0,0 +1,41 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class ParamsModel extends Model_Tree { + + public function __construct() { + $this->_tables = 'params'; + $this->_idFields = 'id_par'; + + parent::__construct(); + } + + public $formStruct = array( + 'entries' => array( + 'updating' => array( + 'type'=>'Select', + 'options'=>'no,yes', + ), + 'id_par' => array( + 'type' => 'Hidden' + ) + ), + ); +} \ No newline at end of file diff --git a/h-source/Application/Models/PrintersModel.php b/h-source/Application/Models/PrintersModel.php new file mode 100644 index 0000000..8d5991e --- /dev/null +++ b/h-source/Application/Models/PrintersModel.php @@ -0,0 +1,68 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class PrintersModel extends BaseModel +{ + + public $type = 'printer'; //device type + + public function __construct() + { + + $this->_popupItemNames = array( + 'vendor' => 'vendor', + 'compatibility' => 'compatibility', + 'comm_year' => 'comm_year', + 'interface' => 'interface', + ); + + $this->_popupLabels = array( + 'vendor' => gtext("vendor"), + 'compatibility' => gtext("compatibility"), + 'comm_year' => gtext("year"), + 'interface' => gtext("interface"), + ); + + $this->_popupWhere = array( + 'vendor' => 'type="printer" and deleted="no"', + 'compatibility' => 'type="printer" and deleted="no"', + 'comm_year' => 'type="printer" and deleted="no"', + 'interface' => 'type="printer" and deleted="no"', + ); + + $this->diffFields = array( + 'vendor' => gtext("vendor"), + 'model' => gtext('model name'), + 'pci_id' => gtext("VendorID:ProductID code of the device"), + 'comm_year' => gtext('year of commercialization'), + 'interface' => gtext("interface"), + 'distribution' => gtext('GNU/Linux distribution used for the test'), + 'compatibility' => gtext('compatibility with free software'), + 'kernel' => gtext('tested with the following kernel libre'), + 'driver' => gtext("free driver used"), + 'description' => gtext('Description'), + ); + + $this->fieldsWithBreaks = array(gtext('Description')); + + parent::__construct(); + } + +} \ No newline at end of file diff --git a/h-source/Application/Models/ProfileModel.php b/h-source/Application/Models/ProfileModel.php new file mode 100644 index 0000000..c282b4f --- /dev/null +++ b/h-source/Application/Models/ProfileModel.php @@ -0,0 +1,70 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class ProfileModel extends Model_Tree { + + public function __construct() { + $this->_tables = 'profile'; + $this->_idFields = 'id_prof'; + + $this->_where=array( + 'username' => 'regusers', + 'has_confirmed' => 'regusers', + 'deleted' => 'regusers' + ); + + $this->softConditions['update'] = array( + "checkLength|90" => "real_name,where_you_are,fav_distro,birth_date,website|the fields 'real name', 'where_you_are', 'favorite distro', 'website' and 'birthdate' don't have to have more than 90 characters", + "checkLength|1000" => "projects,description|the fields 'projects' and 'description' don't have to have more than 1000 characters", + "checkIsStrings|no,yes" => "publish_mail" + ); + + parent::__construct(); + } + + public $formStruct = array( + + 'entries' => array( + 'real_name' => array('labelString'=>'Your real name'), + 'website' => array('labelString'=>'Your website address (add http://)'), + 'where_you_are' => array('labelString'=>'I\'m from...'), + 'birth_date' => array('labelString'=>'My birthdate'), + 'fav_distro' => array('labelString'=>'My favourite distribution'), + 'projects' => array( + 'type' => 'Textarea', + 'labelString'=>'Free software projects I\'m working on' + ), + 'publish_mail' => array( + 'type' => 'Select', + 'options' => 'no,yes', + 'labelString'=> 'Would you like to publish your e-mail address?' + ), + 'description' => array( + 'type' => 'Textarea', + 'labelString'=> 'Your description' + ), + 'id_prof' => array( + 'type' => 'Hidden' + ) + ), + + ); + +} \ No newline at end of file diff --git a/h-source/Application/Models/RevisionsModel.php b/h-source/Application/Models/RevisionsModel.php new file mode 100644 index 0000000..203da64 --- /dev/null +++ b/h-source/Application/Models/RevisionsModel.php @@ -0,0 +1,48 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class RevisionsModel extends Model_Tree { + + public $id_user = 0; + public $type = ''; //device type + + public function __construct() { + $this->_tables='revisions'; + $this->_idFields='id_rev'; + + $this->_where=array( + 'id_hard'=>'revisions' + ); + + $this->orderBy = 'id_rev desc'; + + parent::__construct(); + } + + public function getIdHard($id_rev = 0) + { + $clean['id_rev'] = (int)$id_rev; + + $res = $this->db->select('revisions','id_hard','id_rev='.$clean['id_rev']); + + return (count($res) > 0) ? $res[0]['revisions']['id_hard'] : 0; + } + +} \ No newline at end of file diff --git a/h-source/Application/Models/ScannersModel.php b/h-source/Application/Models/ScannersModel.php new file mode 100644 index 0000000..74e2bdd --- /dev/null +++ b/h-source/Application/Models/ScannersModel.php @@ -0,0 +1,68 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class ScannersModel extends BaseModel +{ + + public $type = 'scanner'; //device type + + public function __construct() + { + + $this->_popupItemNames = array( + 'vendor' => 'vendor', + 'compatibility' => 'compatibility', + 'comm_year' => 'comm_year', + 'interface' => 'interface', + ); + + $this->_popupLabels = array( + 'vendor' => gtext("vendor"), + 'compatibility' => gtext("compatibility"), + 'comm_year' => gtext("year"), + 'interface' => gtext("interface"), + ); + + $this->_popupWhere = array( + 'vendor' => 'type="scanner" and deleted="no"', + 'compatibility' => 'type="scanner" and deleted="no"', + 'comm_year' => 'type="scanner" and deleted="no"', + 'interface' => 'type="scanner" and deleted="no"', + ); + + $this->diffFields = array( + 'vendor' => gtext("vendor"), + 'model' => gtext('model name'), + 'pci_id' => gtext("VendorID:ProductID code of the device"), + 'comm_year' => gtext('year of commercialization'), + 'interface' => gtext("interface"), + 'distribution' => gtext('GNU/Linux distribution used for the test'), + 'compatibility' => gtext('compatibility with free software'), + 'kernel' => gtext('tested with the following kernel libre'), + 'driver' => gtext("free driver used"), + 'description' => gtext('Description'), + ); + + $this->fieldsWithBreaks = array(gtext('Description')); + + parent::__construct(); + } + +} \ No newline at end of file diff --git a/h-source/Application/Models/TalkModel.php b/h-source/Application/Models/TalkModel.php new file mode 100644 index 0000000..992ffa9 --- /dev/null +++ b/h-source/Application/Models/TalkModel.php @@ -0,0 +1,52 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class TalkModel extends Model_Tree { + + public function __construct() { + $this->_tables = 'talk'; + $this->_idFields = 'id_talk'; + + $this->_where=array( + 'id_hard' => 'talk' + ); + + $this->orderBy = 'talk.id_talk desc'; + + $this->strongConditions['insert'] = array( + "checkLength|99" => 'title', + "+checkNotEmpty" => 'message', + "++checkLength|5000" => 'message', + ); + + parent::__construct(); + } + + public $formStruct = array( + 'entries' => array( + 'title' => array(), + 'message' => array('type'=>'Textarea'), + 'id_talk' => array( + 'type' => 'Hidden' + ) + ), + ); + +} \ No newline at end of file diff --git a/h-source/Application/Models/UsersModel.php b/h-source/Application/Models/UsersModel.php new file mode 100755 index 0000000..c425079 --- /dev/null +++ b/h-source/Application/Models/UsersModel.php @@ -0,0 +1,221 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class UsersModel extends Model_Map +{ + + public static $usersList = array(); + + public function __construct() + { + $this->_tables='regusers,reggroups,regusers_groups'; + $this->_idFields='id_user,id_group'; + + $this->_where=array( + 'id_group' => 'reggroups', + 'id_user' => 'regusers', + 'name' => 'reggroups', + 'confirmation_token'=> 'regusers', + 'has_confirmed' => 'regusers', + 'deleted' => 'regusers', + 'forgot_token' => 'regusers' + ); + + $this->_popupItemNames = array( + 'has_confirmed'=>'has_confirmed', + 'deleted'=>'deleted', + 'id_group'=>'name', + ); + + $this->_popupLabels = array( + 'has_confirmed'=>'HAS CONFIRMED?', + 'deleted'=>'DELETED?', + 'id_group'=>'GROUP' + ); + + $this->orderBy = 'regusers.id_user desc'; + + parent::__construct(); + + $this->deleteNotRegistered(); + } + + public function deleteNotRegistered() + { + $limit = time() - Account::$confirmTime; + $this->db->del('regusers','has_confirmed = 1 and deleted = "no" and creation_time < '.$limit); + } + + public function getUser($id_user = 0) + { + $clean['id_user'] = (int)$id_user; + if (array_key_exists($clean['id_user'],self::$usersList)) + { + return self::$usersList[$clean['id_user']]; + } + else + { + $user = $this->db->select('regusers','username,has_confirmed','id_user='.$clean['id_user']); + if (count($user) > 0) + { + $fuser = (strcmp($user[0]['regusers']['has_confirmed'],0) === 0) ? $user[0]['regusers']['username'] : "__".$user[0]['regusers']['username']; + self::$usersList[$clean['id_user']] = $fuser; + return $fuser; + } + else + { + return "__"; + } + } + } + + public function insert() + { + //create the token + $confirmation_token = md5(randString(20)); + $this->values['confirmation_token'] = $confirmation_token; + //has_confirmed flag + $this->values['has_confirmed'] = 1; + $this->values['creation_time'] = time(); + + //random ID + $randomId = md5(randString(5).uniqid(mt_rand(),true)); + $this->values["temp_field"] = $randomId; + + if (isset($_POST['captcha'])) + { + if ( strcmp($_SESSION['captchaString'],$_POST['captcha']) === 0 ) + { + + parent::insert(); + + if ($this->queryResult) + { + $resId = $this->db->select("regusers","id_user","temp_field='$randomId'"); + $clean['id_user'] = $resId[0]['regusers']['id_user']; + $this->db->update("regusers",'temp_field',array(''),'id_user='.$clean['id_user']); + + $result = Account::confirm($this->values['username'],$this->values['e_mail'],$clean['id_user'],$confirmation_token); + + if ($result) + { + $_SESSION['status'] = 'sent'; + } + else + { + $_SESSION['status'] = 'regerror'; + } + + $hed = new HeaderObj(DOMAIN_NAME); + $hed->redirect('users/notice/'.Lang::$current); + } + + } + else + { + $this->result = false; + $this->queryResult = false; + $this->notice = "
    Wrong captcha code...
    \n"; + } + } + } + + public function close($id_user) + { + $clean['id_user'] = (int)$id_user; + + $this->values = array( + 'has_confirmed' => 1, + 'deleted' => 'yes', + 'e_mail' => '' + ); + + if ($this->update($clean['id_user'])) + { + $_SESSION['status'] = 'deleted'; + + $profile = new ProfileModel(); + $res = $profile->db->select('profile','id_prof','created_by='.$clean['id_user']); + + if (count($res) > 0) + { + $clean['id_prof'] = (int)$res[0]['profile']['id_prof']; + $profile->values = array( + 'real_name' => '', + 'where_you_are' => '', + 'birth_date' => '', + 'fav_distro' => '', + 'projects' => '', + 'description' => '' + ); + $profile->update($clean['id_prof']); + } + } + + } + + public function forgot($username) + { + $clean['username'] = ctype_alnum($username) ? sanitizeAll($username) : ''; + + if (isset($_POST['captcha'])) + { + if ( strcmp($_SESSION['captchaString'],$_POST['captcha']) === 0 ) + { + $res = $this->db->select('regusers','e_mail,id_user','username="'.$clean['username'].'" and has_confirmed = 0 and deleted = "no"'); + if (count($res) > 0) + { + $e_mail = $res[0]['regusers']['e_mail']; + $id_user = (int)$res[0]['regusers']['id_user']; + $forgot_token = md5(randString(20)); + $forgot_time = time(); + $updateArray = array($forgot_token, $forgot_time); + $this->db->update('regusers','forgot_token,forgot_time',$updateArray,'username="'.$clean['username'].'"'); + + $result = Account::sendnew($clean['username'],$e_mail,$id_user,$forgot_token); + + if ($result) + { + $_SESSION['status'] = 'sent_new'; + } + else + { + $_SESSION['status'] = 'sent_new_error'; + } + + $hed = new HeaderObj(DOMAIN_NAME); + $hed->redirect('users/notice/'.Lang::$current,1); + + } + else + { + $this->notice = "
    the user does not exist
    \n"; + } + } + else + { + $this->result = false; + $this->queryResult = false; + $this->notice = "
    Wrong captcha code...
    \n"; + } + } + } + +} \ No newline at end of file diff --git a/h-source/Application/Models/VideocardsModel.php b/h-source/Application/Models/VideocardsModel.php new file mode 100644 index 0000000..fb90a31 --- /dev/null +++ b/h-source/Application/Models/VideocardsModel.php @@ -0,0 +1,64 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class VideocardsModel extends BaseModel +{ + + public $type = 'videocard'; //device type + + public function __construct() + { + + $this->_popupItemNames = array( + 'vendor' => 'vendor', + 'comm_year' => 'comm_year', + 'interface' => 'interface', + ); + + $this->_popupLabels = array( + 'vendor' => gtext("vendor"), + 'comm_year' => gtext("year"), + 'interface' => gtext("interface"), + ); + + $this->_popupWhere = array( + 'vendor' => 'type="videocard" and deleted="no"', + 'comm_year' => 'type="videocard" and deleted="no"', + 'interface' => 'type="videocard" and deleted="no"', + ); + + $this->diffFields = array( + 'vendor' => gtext("vendor"), + 'model' => gtext('model name'), + 'pci_id' => gtext("VendorID:ProductID code of the device"), + 'comm_year' => gtext('year of commercialization'), + 'interface' => gtext("interface"), + 'distribution' => gtext('GNU/Linux distribution used for the test'), + 'kernel' => gtext('tested with the following kernel libre'), + 'video_card_works' => gtext("how does it work with free software?"), + 'description' => gtext('Description'), + ); + + $this->fieldsWithBreaks = array(gtext('Description')); + + parent::__construct(); + } + +} \ No newline at end of file diff --git a/h-source/Application/Models/WifiModel.php b/h-source/Application/Models/WifiModel.php new file mode 100644 index 0000000..1322cdd --- /dev/null +++ b/h-source/Application/Models/WifiModel.php @@ -0,0 +1,67 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class WifiModel extends BaseModel +{ + + public $type = 'wifi'; //device type + + public function __construct() + { + + $this->_popupItemNames = array( + 'vendor' => 'vendor', + 'comm_year' => 'comm_year', + 'wifi_works' => 'wifi_works', + 'interface' => 'interface', + ); + + $this->_popupLabels = array( + 'vendor' => gtext("vendor"), + 'comm_year' => gtext("year"), + 'wifi_works' => gtext("does it work?"), + 'interface' => gtext("interface"), + ); + + $this->_popupWhere = array( + 'vendor' => 'type="wifi" and deleted="no"', + 'comm_year' => 'type="wifi" and deleted="no"', + 'wifi_works' => 'type="wifi" and deleted="no"', + 'interface' => 'type="wifi" and deleted="no"', + ); + + $this->diffFields = array( + 'vendor' => gtext("vendor"), + 'model' => gtext('model name'), + 'pci_id' => gtext("VendorID:ProductID code of the device"), + 'comm_year' => gtext('year of commercialization'), + 'interface' => gtext("interface"), + 'distribution' => gtext('GNU/Linux distribution used for the test'), + 'kernel' => gtext('tested with the following kernel libre'), + 'wifi_works' => gtext("does it work with free software?"), + 'description' => gtext('Description'), + ); + + $this->fieldsWithBreaks = array(gtext('Description')); + + parent::__construct(); + } + +} \ No newline at end of file diff --git a/h-source/Application/Modules/ModBase.php b/h-source/Application/Modules/ModBase.php new file mode 100644 index 0000000..44d25a2 --- /dev/null +++ b/h-source/Application/Modules/ModBase.php @@ -0,0 +1,41 @@ +simpleXmlObj->classname)) + { + return " class='".$this->simpleXmlObj->classname[0]."' "; + } + return null; + } + + //wrap the html with a
    + //look for the
    tag in the xml in order to set the class of the div + public function wrapDiv($string) + { + $divOpen = "
    "; + $divClose = "
    "; + + if (isset($this->simpleXmlObj->div)) + { + $divOpen = "
    "; + } + + return $divOpen . $string . $divClose; + } + +} \ No newline at end of file diff --git a/h-source/Application/Modules/ModImage.php b/h-source/Application/Modules/ModImage.php new file mode 100644 index 0000000..5a116b1 --- /dev/null +++ b/h-source/Application/Modules/ModImage.php @@ -0,0 +1,45 @@ +simpleXmlObj->width)) + { + return " width = '" . $this->simpleXmlObj->width ."' "; + } + return null; + } + + public function heightPropertyString() + { + if (isset($this->simpleXmlObj->height)) + { + return " height = '" . $this->simpleXmlObj->height ."' "; + } + return null; + } + + public function titlePropertyString() + { + if (isset($this->simpleXmlObj->title)) + { + return " title = '" . $this->simpleXmlObj->title ."' "; + } + return null; + } + + public function render() + { + $link = "getHtmlClass().$this->widthPropertyString().$this->heightPropertyString().$this->titlePropertyString()." src='".$this->simpleXmlObj->src[0]."'>"; + return $this->wrapDiv($link)."\n"; + } + +} \ No newline at end of file diff --git a/h-source/Application/Modules/ModLink.php b/h-source/Application/Modules/ModLink.php new file mode 100644 index 0000000..011bc78 --- /dev/null +++ b/h-source/Application/Modules/ModLink.php @@ -0,0 +1,18 @@ +getHtmlClass()." href='".$this->simpleXmlObj->href[0]."'>".$this->simpleXmlObj->text[0].""; + return $this->wrapDiv($link)."\n"; + } + +} \ No newline at end of file diff --git a/h-source/Application/Modules/ModLinkimage.php b/h-source/Application/Modules/ModLinkimage.php new file mode 100644 index 0000000..8e49bbf --- /dev/null +++ b/h-source/Application/Modules/ModLinkimage.php @@ -0,0 +1,18 @@ +getHtmlClass()." href='".$this->simpleXmlObj->href[0]."'>widthPropertyString().$this->heightPropertyString().$this->titlePropertyString()." src='".$this->simpleXmlObj->src[0]."'>"; + return $this->wrapDiv($link)."\n"; + } + +} \ No newline at end of file diff --git a/h-source/Application/Modules/ModRaw.php b/h-source/Application/Modules/ModRaw.php new file mode 100644 index 0000000..4ed3226 --- /dev/null +++ b/h-source/Application/Modules/ModRaw.php @@ -0,0 +1,18 @@ +simpleXmlObj->text[0]; + return $this->wrapDiv($link)."\n"; + } + +} \ No newline at end of file diff --git a/h-source/Application/Modules/index.html b/h-source/Application/Modules/index.html new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/h-source/Application/Modules/index.html @@ -0,0 +1 @@ + diff --git a/h-source/Application/Strings/Lang/It/DbCondStrings.php b/h-source/Application/Strings/Lang/It/DbCondStrings.php new file mode 100644 index 0000000..4c985cd --- /dev/null +++ b/h-source/Application/Strings/Lang/It/DbCondStrings.php @@ -0,0 +1,17 @@ +Il valore del campo ". $field ." è già presente. Per favore scegline un altro.
    \n"; + } + +} diff --git a/h-source/Application/Strings/Lang/It/ModelStrings.php b/h-source/Application/Strings/Lang/It/ModelStrings.php new file mode 100644 index 0000000..e02013b --- /dev/null +++ b/h-source/Application/Strings/Lang/It/ModelStrings.php @@ -0,0 +1,19 @@ + "
    Errore nella query: contatta l'amministratore!
    \n", + "executed" => "
    operazione eseguita!
    \n", + "associate" => "
    Problema di integrità referenziale: il record è associato ad un record di una tabella figlia. Devi prima rompere l'associazione.
    \n", + "no-id" => "
    Non è definito alcun id della query
    \n", + "not-linked" => "
    Il record non è associato, non puoi dissociarlo
    ", + "linked" => "
    Il record è già associato, non puoi associarlo un'altra volta
    " + ); + +} diff --git a/h-source/Application/Strings/Lang/It/UploadStrings.php b/h-source/Application/Strings/Lang/It/UploadStrings.php new file mode 100644 index 0000000..57bcda6 --- /dev/null +++ b/h-source/Application/Strings/Lang/It/UploadStrings.php @@ -0,0 +1,26 @@ + "
    Errore: verificare i permessi del file/directory
    \n", + "executed" => "
    Operazione eseguita!
    \n", + "not-child" => "
    La cartella selezionata non è una sotto directory della directory base
    \n", + "not-dir" => "
    La cartella selezionata non è una directory
    \n", + "not-empty" => "
    La cartella selezionata non è vuota
    \n", + "no-folder-specified" => "
    Non è stata specificata alcuna cartella
    \n", + "not-writable" => "
    La cartella non è scrivibile
    \n", + "not-writable-file" => "
    Il file non è scrivibile
    \n", + "dir-exists" => "
    Esiste già una directory con lo stesso nome
    \n", + "no-upload-file" => "
    Non c'è alcun file di cui fare l'upload
    \n", + "size-over" => "
    La dimensione del file è troppo grande
    \n", + "not-allowed-ext" => "
    L'estensione del file che vuoi caricare non è consentita
    \n", + "file-exists" => "
    Esiste già un file con lo stesso nome
    \n", + ); + +} diff --git a/h-source/Application/Strings/Lang/It/ValCondStrings.php b/h-source/Application/Strings/Lang/It/ValCondStrings.php new file mode 100644 index 0000000..a54c650 --- /dev/null +++ b/h-source/Application/Strings/Lang/It/ValCondStrings.php @@ -0,0 +1,69 @@ +". $element ." non è stato definito
    \n"; + } + + //if the elements are not equal + public function getNotEqualResultString($element) + { + return "
    Differenti valori: $element
    \n"; + } + + //if the element is not alphabetic + public function getNotAlphabeticResultString($element) + { + return "
    ".$element." deve essere una stringa di soli caratteri alfabetici
    \n"; + } + + //if the element is not alphanumeric + public function getNotAlphanumericResultString($element) + { + return "
    ".$element." deve essere una stringa di soli caratteri alfanumerici
    \n"; + } + + //if the element is not a decimal digit + public function getNotDecimalDigitResultString($element) + { + return "
    ".$element." deve essere una stringa di soli numeri decimali
    \n"; + } + + //if the element has the mail format + public function getNotMailFormatResultString($element) + { + return "
    ".$element." non sembra un indirizzo e-mail
    \n"; + } + + //if the element is numeric + public function getNotNumericResultString($element) + { + return "
    ".$element." deve essere un numero
    \n"; + } + + //if the element (string) length exceeds the value of characters (defined by $maxLength) + public function getLengthExceedsResultString($element,$maxLength) + { + return "
    ".$element." non deve essere composto da più di $maxLength caratteri
    \n"; + } + + //if the element is one of the strings indicated by $stringList (a comma-separated list of strings) + public function getIsForbiddenStringResultString($element,$stringList) + { + return "
    ".$element." non può assumere uno dei seguenti valori: $stringList
    \n"; + } + + //if the element is not one of the strings indicated by $stringList (a comma-separated list of strings) + public function getIsNotStringResultString($element,$stringList) + { + return "
    ".$element." deve assumere uno dei seguenti valori: $stringList
    \n"; + } +} diff --git a/h-source/Application/Strings/Lang/It/index.html b/h-source/Application/Strings/Lang/It/index.html new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/h-source/Application/Strings/Lang/It/index.html @@ -0,0 +1 @@ + diff --git a/h-source/Application/Strings/Lang/index.html b/h-source/Application/Strings/Lang/index.html new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/h-source/Application/Strings/Lang/index.html @@ -0,0 +1 @@ + diff --git a/h-source/Application/Strings/index.html b/h-source/Application/Strings/index.html new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/h-source/Application/Strings/index.html @@ -0,0 +1 @@ + diff --git a/h-source/Application/Views/Contact/index.php b/h-source/Application/Views/Contact/index.php new file mode 100644 index 0000000..bac30f4 --- /dev/null +++ b/h-source/Application/Views/Contact/index.php @@ -0,0 +1,29 @@ + + +. +?> + +
    + +
    + ">Home » contact +
    + +

    write in the file Application/Views/Contact/index.php your contact information

    + +
    diff --git a/h-source/Application/Views/Contact/index_es.php b/h-source/Application/Views/Contact/index_es.php new file mode 100644 index 0000000..acaf264 --- /dev/null +++ b/h-source/Application/Views/Contact/index_es.php @@ -0,0 +1,29 @@ + + +. +?> + +
    + +
    + ">Home » contact +
    + + + +
    diff --git a/h-source/Application/Views/Contact/index_it.php b/h-source/Application/Views/Contact/index_it.php new file mode 100644 index 0000000..acaf264 --- /dev/null +++ b/h-source/Application/Views/Contact/index_it.php @@ -0,0 +1,29 @@ + + +. +?> + +
    + +
    + ">Home » contact +
    + + + +
    diff --git a/h-source/Application/Views/Credits/index.php b/h-source/Application/Views/Credits/index.php new file mode 100644 index 0000000..fe327f3 --- /dev/null +++ b/h-source/Application/Views/Credits/index.php @@ -0,0 +1,63 @@ + + +. +?> + +
    + +
    + ">Home » credits +
    + +
    + +
    + Icons: +
    + +
    + The icons used inside are taken from the ACUN Simgeleri 0.7 icon theme and from the H2O Icon Theme 0.0.5, both licensed under the GNU GPL license, from the Crystal Projects icons, licensed under the LGPL, from the glaze icons set (LGPL) and from the DarkGlass_Reworked icons theme (GPL). The flag icons are taken from the FAMFAMFAM flag icons set (Public Domain). +
    + +
    + jQuery: +
    + +
    + The jQuery and the jQuery UI javascript libraries (licensed under MIT/GPL) have been used through the website +
    + +
    + markitup: +
    + +
    + The markitup jQuery plugin (licensed under MIT/GPL) has been used in order to help the user to insert wiki tags +
    + +
    + php diff algorithm: +
    + +
    + This algorithm (licensed under the zlib free license) has been used in order to highlight the differences between two different revisions of the same hadrware model. +
    + +
    + +
    diff --git a/h-source/Application/Views/Credits/index_es.php b/h-source/Application/Views/Credits/index_es.php new file mode 100644 index 0000000..3efea33 --- /dev/null +++ b/h-source/Application/Views/Credits/index_es.php @@ -0,0 +1,63 @@ + + +. +?> + +
    + +
    + ">Home » credits +
    + +
    + +
    + Iconos: +
    + +
    + Los iconos usados dentro de son tomados de el tema de iconos ACUN Simgeleri 0.7 y de H2O Icon Theme 0.0.5, ambos licenciados bajo la licencia GNU GPL, de Crystal Projects, licenciado bajo la LGPL, de glaze icons set (LGPL) y de DarkGlass_Reworked icons theme (GPL). Los iconos de las banderas son tomados la colección de iconos de banderas FAMFAMFAM (Dominio Público) +
    + +
    + jQuery: +
    + +
    + Las bibliotecas javascript jQuery y jQuery UI (licenciadas bajo MIT/GPL) han sido usadas en el sitio +
    + +
    + markitup: +
    + +
    + El complemento markitup jQuery (licenciado bajo MIT/GPL) ha sido usado en orden de ayudar al usuario a insertar etiquetas wiki +
    + +
    + php diff algorithm: +
    + +
    + Este algoritmo (licenciado bajo la licencia libre de zlib) ha sido usado en orden de remarcar las diferencias entre dos diferentes revisiones del mismo modelo de hardware. +
    + +
    + +
    diff --git a/h-source/Application/Views/Credits/index_it.php b/h-source/Application/Views/Credits/index_it.php new file mode 100644 index 0000000..0d32ebd --- /dev/null +++ b/h-source/Application/Views/Credits/index_it.php @@ -0,0 +1,64 @@ + + +. +?> + +
    + +
    + ">Home » credits +
    + +
    + +
    + Icone: +
    + +
    + Le icone utilizzate nel sito h-node.com appartengono ai temi di icone ACUN Simgeleri 0.7 e H2O Icon Theme 0.0.5, entrambi sotto licenza GNU GPL, e al tema Crystal Projects, sotto licenza LGPL, al set di icone glaze (LGPL) e al tema DarkGlass_Reworked (GPL). Le icone bandiere derivano dal set di icone FAMFAMFAM (Public Domain). +
    + + +
    + jQuery: +
    + +
    + Le librerie javascript jQuery e jQuery UI (sotto licenza MIT/GPL) sono state usate nel sito +
    + +
    + markitup: +
    + +
    + Il plugin jQuery markitup (sotto licenza MIT/GPL) è stata usata per aiutare gli utenti a inserire i tag della wiki
    + +
    + Algoritmo php diff: +
    + +
    + Questo algoritmo (sotto licenza libera zlib) è stata usata per sottolineare la differenza tra due diverse revisioni dello stesso modello di hardware. +
    + + +
    + +
    diff --git a/h-source/Application/Views/Download/index.php b/h-source/Application/Views/Download/index.php new file mode 100644 index 0000000..e296711 --- /dev/null +++ b/h-source/Application/Views/Download/index.php @@ -0,0 +1,68 @@ + + +. +?> + +
    + +
    + ">Home » download +
    + +
    + +
    + Download the h-node hardware database in xml format: +
    + +
    + You can download all the h-node database in one unique xml file in order to parse its contents by means of some proper script (for example a Python or Perl or PHP script) + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Download the xml file of all the database">
    Download the xml file of all the notebooks in the database">
    Download the xml file of all the wifi cards in the database">
    Download the xml file of all the video cards in the database">
    Download the xml file of all the printers in the database">
    Download the xml file of all the scanners in the database">
    +
    +
    + +
    + +
    diff --git a/h-source/Application/Views/Download/index_es.php b/h-source/Application/Views/Download/index_es.php new file mode 100644 index 0000000..b181b23 --- /dev/null +++ b/h-source/Application/Views/Download/index_es.php @@ -0,0 +1,68 @@ + + +. +?> + +
    + +
    + ">Home » download +
    + +
    + +
    + Descargue la base de datos de h-node.com en formato xml: +
    + +
    + Puede descargar toda la base de datos de h-node en un único archivo xml en orden de procesar sus contenidos por medio de un algoritmo (por ejemplo un algoritmo en Python o Perl o PHP) + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Descargue el archivo xml de toda la base de datos">
    Descargue el archivo xml de todas las laptops en la base de datos">
    Descargue el archivo xml de todas las tarjetas inalámbricas en la base de datos">
    Descargue el archivo xml de todas las tarjetas de video en la base de datos">
    Descargue el archivo xml de todas las impresoras en la base de datos">
    Download the xml file of all the scanners in the database">
    +
    +
    + +
    + +
    diff --git a/h-source/Application/Views/Download/index_it.php b/h-source/Application/Views/Download/index_it.php new file mode 100644 index 0000000..16fb40a --- /dev/null +++ b/h-source/Application/Views/Download/index_it.php @@ -0,0 +1,68 @@ + + +. +?> + +
    + +
    + ">Home » download +
    + +
    + +
    + Scarica il database dell'hardware di h-node in formato xml: +
    + +
    + Puoi scaricare l'intero database di h-node in un unico file xml per analizzarne i contenuti utilizzando uno script appropriato (ad esempio uno script Python o Perl o PHP) + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Scarica il file xml dell'intero database">
    Scarica il file xml di tutti i notebooks del database">
    Scarica il file xml di tutte le schede wifi del database">
    Scarica il file xml di tutte le schede video del database">
    Scarica il file xml di tutte le stampanti del database">
    Scarica il file xml di tutti gli scanner del database">
    +
    +
    + +
    + +
    diff --git a/h-source/Application/Views/Download/xml.php b/h-source/Application/Views/Download/xml.php new file mode 100644 index 0000000..b473875 --- /dev/null +++ b/h-source/Application/Views/Download/xml.php @@ -0,0 +1,20 @@ + + + +. +?> \ No newline at end of file diff --git a/h-source/Application/Views/Hardware/left.php b/h-source/Application/Views/Hardware/left.php new file mode 100644 index 0000000..974340d --- /dev/null +++ b/h-source/Application/Views/Hardware/left.php @@ -0,0 +1,47 @@ + + +. +?> + +
    + +
    + ">Home » Hardware +
    + +
    + Notebooks +
    + + + + + +
    + Printers +
    + +
    + Scanners +
    + +
    \ No newline at end of file diff --git a/h-source/Application/Views/Help/index.php b/h-source/Application/Views/Help/index.php new file mode 100644 index 0000000..8412f1d --- /dev/null +++ b/h-source/Application/Views/Help/index.php @@ -0,0 +1,361 @@ + + +. +?> + +
    + +
    + ">Home » help +
    + + + +

    Wiki syntax

    + +

    List of wiki tags

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    nametagresultdescription
    bold[b]text[/b]texttext bold
    italic[i]text[/i]texttext italic
    del[del]text[/del]texttext deleted
    underline[u]text[/u]texttext underlined
    head 1[h1]text[/h1]
    text
    head 1
    head 2[h2]text[/h2]
    text
    head 2
    head 3[h3]text[/h3]
    text
    head 3
    paragraph[p]text[/p]

    text

    new paragraph
    list[list]list[/list]<ul>list</ul>make a list of items
    numbered list[enum]list[/enum]<ol>list</ol>make a numbered list of items
    list item[*]item[/*]<li>item</li>ad an item to a list
    code[code]some code[/code]
    some code
    ad some code
    simple link[a]url[/a]<a href="url">url</a>simple link
    link with text[a]url|text[/a]<a href="url">text</a>link with text
    notebook[notebook]id[/notebook] link to the notebook with the identifier equal to id (the identifier of each device model is written in the page of the device itself, next to the model name)
    wifi[wifi]id[/wifi] link to the wifi with the identifier equal to id (the identifier of each device model is written in the page of the device itself, next to the model name)
    videocard[videocard]id[/videocard] link to the videocard with the identifier equal to id (the identifier of each device model is written in the page of the device itself, next to the model name)
    + +

    Compatibility classes

    + +

    Notebooks

    + +

    Class A (Platinum)

    + +

    All the notebook devices work with a very good performance. Example: all the devices work, the 3D acceleration is supported

    + +

    Class B (Gold)

    + +

    All the notebook devices work but not at full performance. A typical example: all the devices work, but the 3D acceleration is not supported

    + +

    Class C (Silver)

    + +

    One main device is not supported. Example: the internal wifi card does not work. You need an external USB card

    + +

    Class D (Bronze)

    + +

    More than one device is not supported

    + +

    Class E (Garbage)

    + +

    The notebook does not work with free software

    + + +

    Printers

    + +

    Class A (Full)

    + +

    All device functions and features are supported

    + +

    Class B (Partial)

    + +

    Printing supported but possibly at limited speed or print quality; scanning and/or faxing on some multifunction devices may not be supported

    + +

    Class C (None)

    + +

    The printer does not work with free software

    + + +

    Scanners

    + +

    Class A (Full)

    + +

    All device functions and features are supported

    + +

    Class B (Partial)

    + +

    Scanning supported but possibly at limited speed or quality; some other features may not be supported

    + +

    Class C (None)

    + +

    The scanner does not work with free software

    + +

    Discover your hardware

    +
    + (Thanks lluvia) +
    + +

    In order to know the details of your hardware you can carry out the following actions:

    + +

    How to discover the model name of your notebook

    + +

    See below your notebook or netbook

    + + + +

    How to discover the kernel libre version you are using

    + +

    Open a terminal and type the following command:

    + +
    +		uname -r
    +	
    + +

    How to discover the name of your video card

    + +

    Open a terminal and type the following command:

    + +
    +		sudo lspci
    +	
    + +

    Then look for the row containing the string VGA or Display controller. You can also try one of the following commands:

    + +
    +		lspci | grep "Display controller"
    +	
    + +

    or

    + +
    +		lspci | grep "VGA"
    +	
    + +

    How to discover the VendorID and the ProductID of your device (VendorID:ProductID code)

    + +
    + (Thanks Michał Masłowski and Julius22) +
    + +

    If the device is integrated (example: a video card)

    + +

    Open a terminal and type the following command:

    + +
    +		sudo lspci -nnk
    +	
    + +

    You should obtain a list of hardware similar to the one written below

    + +
    +	03:00.0 Network controller [0280]: Broadcom Corporation BCM4311 802.11b/g WLAN [14e4:4311] (rev 02)
    +	Kernel driver in use: b43-pci-bridge
    +	Kernel modules: ssb
    +	05:00.0 VGA compatible controller [0300]: nVidia Corporation G86 [GeForce 8400M GS] [10de:0427] (rev a1)
    +	Kernel modules: nouveau, nvidiafb
    +	
    + +

    The strings in bold and placed inside the square brackets (in the above list) are the code you are looking for. The first set of digits (before the colon) are the VendorID, the second set of digits are the ProductID. In the above example: the VendorID:ProductID code of the wifi card (note the strings "Network controller" and "WLAN") is 14e4:4311 while the VendorID:ProductID code of the video card (note the string "VGA") is 10de:0427

    + +

    If the device is an USB device (example: an external USB wifi card)

    + +

    Open a terminal and type the following command:

    + +
    +		sudo lsusb
    +	
    + +

    You should obtain a list of hardware similar to the one written below

    + +
    +	Bus 001 Device 002: ID 0846:4260 NetGear, Inc. WG111v3 54 Mbps Wireless [realtek RTL8187B]
    +	Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    +	Bus 002 Device 003: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint Sensor
    +	
    + +

    The strings in bold (in the above list) are the code you are looking for. The first set of digits (before the colon) are the VendorID, the second set of digits are the ProductID. In the above example: the VendorID:ProductID code of the external USB wifi card (note the strings "Wireless") is 0846:4260

    + + +

    How to discover if the video card works

    + +

    Install rss-glx by means of the package manager of your distribution or compiling it from source and try some screensavers (for example Skyrocket or Solarwinds). Check if you can play the screensaver (and/or if you can play it smoothly)

    + +

    How to discover if the 3D acceleration works

    + +

    Try to enable compiz

    + +

    How to discover the name of your wifi card

    + +

    Open a terminal and type the following command:

    + +
    +		sudo lspci
    +	
    + +

    Then look for the row containing the string Wireless or Network controller. You can also try one of the following commands:

    + +
    +		lspci | grep "Wireless" 
    +	
    + +

    or

    + +
    +		lspci | grep "Network" 
    +	
    + +

    How to discover the printer driver you are using

    + +

    If you are using cups

    + +

    Open a terminal and type the following command:

    + +
    +		dpkg-query -W -f '${Version}\n' cups
    +	
    + + +

    List of fully free GNU/Linux distributions

    + +

    They are listed in alphabetical order

    + + + +
    diff --git a/h-source/Application/Views/Help/index_es.php b/h-source/Application/Views/Help/index_es.php new file mode 100644 index 0000000..e218517 --- /dev/null +++ b/h-source/Application/Views/Help/index_es.php @@ -0,0 +1,361 @@ + + +. +?> + +
    + +
    + ">Home » help +
    + + + +

    Sintaxis del Wiki

    + +

    Lista de las etiquetas wiki de

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    nombreetiquetaresultadodescripción
    bold[b]texto[/b]textotexto en negrita
    italic[i]texto[/i]textotexto en cursiva
    del[del]texto[/del]textotexto eliminado
    underline[u]texto[/u]textotexto subrayado
    head 1[h1]texto[/h1]
    texto
    encabezado 1
    head 2[h2]texto[/h2]
    texto
    encabezado 2
    head 3[h3]texto[/h3]
    texto
    encabezado 3
    paragraph[p]texto[/p]

    texto

    nuevo párrafo
    lista[list]lista[/list]<ul>lista</ul>hace una lista de objetos
    numbered list[enum]lista[/enum]<ol>lista</ol>hace una lista numerada de objetos
    list item[*]objeto[/*]<li>objeto</li>agrega un objeto a la lista
    code[code]código[/code]
    código
    agrega código
    simple link[a]url[/a]<a href="url">url</a>enlace simple
    link with text[a]url|text[/a]<a href="url">text</a>enlace con texto
    notebook[notebook]id[/notebook] enlace a la laptop con el identificador id (el identificador de cada modelo de dispositivo esta escrito en la página del dispositivo mismo, seguido del nombre del modelo)
    wifi[wifi]id[/wifi] enlace al wifi con el identificador id (el identificador de cada modelo de dispositivo esta escrito en la página del dispositivo mismo, seguido del nombre del modelo)
    videocard[videocard]id[/videocard] enlace a la tarjeta de video con el identificador id (el identificador de cada modelo de dispositivo esta escrito en la página del dispositivo mismo, seguido del nombre del modelo)
    + +

    Clases de Compatibilidad

    + +

    Laptops

    + +

    Clase A (Platino)

    + +

    Todos los dispositivos funcionan con un buen desempeño. Ejemplo: todos los dispositivos funcionan, la aceleración 3D esta soportada

    + +

    Clase B (Oro)

    + +

    Todos los dispositivos funcionan pero no a su rendimiento completo. Un ejemplo típico es: todos los dispositivos funcionan, pero la aceleración 3D no esta soportada

    + +

    Clase C (Plata)

    + +

    Un dispositivo principal no esta soportado. Ejemplo: la tarjeta inalámbrica interna no funciona. Necesita una tarjeta USB externa

    + +

    Clase D (Bronce)

    + +

    Más de un dispositivo no esta soportado

    + +

    Clase E (Basura)

    + +

    El equipo no funciona con software libre

    + + +

    Impresoras

    + +

    Clase A (Completo)

    + +

    Todos los dispositivos funcionan y las características soportadas

    + +

    Clase B (Parcial)

    + +

    La impresión esta soportada pero a velocidad o calidad limitada; escaneo y/o envío por fax en algunos dispositivos multifuncionales pueden no estar soportados

    + +

    Clase C (Ninguno)

    + +

    La impresora no funciona con software libre

    + + +

    Scanners

    + +

    Class A (Full)

    + +

    All device functions and features are supported

    + +

    Class B (Partial)

    + +

    Scanning supported but possibly at limited speed or quality; some other features may not be supported

    + +

    Class C (None)

    + +

    The scanner does not work with free software

    + +

    Descubra su hardware

    +
    + (Gracias lluvia) +
    + +

    En orden de conocer los detalles de su hardware puede seguir las siguientes acciones:

    + +

    Como descubrir el modelo de su laptop

    + +

    Vea debajo de su laptop o netbook

    + + + +

    Como descubrir la versión de kernel que esta usando

    + +

    Abra una terminal y escriba la siguiente orden:

    + +
    +		uname -r
    +	
    + +

    Como descubrir el nombre de su tarjeta de video

    + +

    Abra una terminal y escriba la siguiente orden:

    + +
    +		sudo lspci
    +	
    + +

    Después busque por la linea que contenga la cadena VGA o Display controller. También puede usar uno de las siguientes ordenes:

    + +
    +		lspci | grep "Display controller"
    +	
    + +

    o

    + +
    +		lspci | grep "VGA"
    +	
    + +

    Como descubrir el ID del vendedor y el ID del producto de su dispositivo (código VendorID:ProductID)

    + +
    + (Gracias Michał Masłowski y Julius22) +
    + +

    Si el dispositivo es integrado (ejemplo: una tarjeta de video)

    + +

    Abra una terminal y escriba la siguiente orden:

    + +
    +		sudo lspci -nnk
    +	
    + +

    Debe de obtener una lista de hardware similar a la escriba debajo

    + +
    +	03:00.0 Network controller [0280]: Broadcom Corporation BCM4311 802.11b/g WLAN [14e4:4311] (rev 02)
    +	Kernel driver in use: b43-pci-bridge
    +	Kernel modules: ssb
    +	05:00.0 VGA compatible controller [0300]: nVidia Corporation G86 [GeForce 8400M GS] [10de:0427] (rev a1)
    +	Kernel modules: nouveau, nvidiafb
    +	
    + +

    Las cadenas en negritas y colocadas en los corchetes (en la lista superior) son los códigos que esta buscando. El primer grupo de dígitos (antes de los dos puntos) son el VendorID, el segundo grupo de dígitos son el ProductID. En el ejemplo superior: el código VendorID:ProductID de la tarjeta inalámbrica (note las cadenas "Network controller" y "WLAN") es 14e4:4311 mientras el código VendorID:ProductID de la tarjeta de video (note la cadena "VGA") es 10de:0427

    + +

    Si el dispositivo es un dispositivo USB (ejemplo: una tarjeta USB externa)

    + +

    Abra una terminal y escriba la siguiente orden:

    + +
    +		sudo lsusb
    +	
    + +

    Debe de obtener una lista de hardware similar a la descrita a continuación

    + +
    +	Bus 001 Device 002: ID 0846:4260 NetGear, Inc. WG111v3 54 Mbps Wireless [realtek RTL8187B]
    +	Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    +	Bus 002 Device 003: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint Sensor
    +	
    + +

    Las cadenas en negritas (en la lista superior) son el código que busca. El primer grupo de dígitos (antes de los dos puntos) son el VendorID, el segundo grupo de dígitos son el ProductID. En el ejemplo superior: el código VendorID:ProductID de la tarjeta inalámbrica USB externa (note la cadena "Wireless") es 0846:4260

    + + +

    Como descubrir si la tarjeta de video funciona

    + +

    Instale rss-glx por lo medios del administrador de paquetes de su distribución o por medio de compilar el código fuente y pruebe algunos protectores de pantalla (por ejemplo Skyrocket o Solarwinds). Revise si puede ejecutar el protector de pantalla (y/o si puede mostrarlo suavemente)

    + +

    Como descubrir si la aceleración 3D funciona

    + +

    Intente activar compiz

    + +

    Como descubrir el nombre de su tarjeta de inalámbrica

    + +

    Abra una terminal y escriba la siguiente orden:

    + +
    +		sudo lspci
    +	
    + +

    Después busque por la linea que contenga la cadena Wireless o Network controller. También puede intentar una de las siguientes ordenes

    + +
    +		lspci | grep "Wireless" 
    +	
    + +

    o

    + +
    +		lspci | grep "Network" 
    +	
    + +

    Como descubrir el driver de la impresora que esta usando

    + +

    If you are using cups

    + +

    Abra una terminal y escriba la orden siguiente:

    + +
    +		dpkg-query -W -f '${Version}\n' cups
    +	
    + + +

    Lista de las distribuciones GNU/Linux completamente libres

    + +

    Están enlistadas en orden alfabético

    + + + +
    diff --git a/h-source/Application/Views/Help/index_fr.php b/h-source/Application/Views/Help/index_fr.php new file mode 100644 index 0000000..0abcd54 --- /dev/null +++ b/h-source/Application/Views/Help/index_fr.php @@ -0,0 +1,352 @@ + + +. +?> + +
    + +
    + ">Home » help +
    + + + +

    Syntaxe Wiki

    + +

    Liste des tags Wiki sur

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    nametagresultdescription
    bold[b]text[/b]texttext bold
    italic[i]text[/i]texttext italic
    del[del]text[/del]texttext deleted
    underline[u]text[/u]texttext underlined
    head 1[h1]text[/h1]
    text
    head 1
    head 2[h2]text[/h2]
    text
    head 2
    head 3[h3]text[/h3]
    text
    head 3
    paragraph[p]text[/p]

    text

    new paragraph
    list[list]list[/list]<ul>list</ul>make a list of items
    numbered list[enum]list[/enum]<ol>list</ol>make a numbered list of items
    list item[*]item[/*]<li>item</li>ad an item to a list
    code[code]some code[/code]
    some code
    ad some code
    simple link[a]url[/a]<a href="url">url</a>simple link
    link with text[a]url|text[/a]<a href="url">text</a>link with text
    notebook[notebook]id[/notebook] link to the notebook with the identifier equal to id (the identifier of each device model is written in the page of the device itself, next to the model name)
    wifi[wifi]id[/wifi] link to the wifi with the identifier equal to id (the identifier of each device model is written in the page of the device itself, next to the model name)
    videocard[videocard]id[/videocard] link to the videocard with the identifier equal to id (the identifier of each device model is written in the page of the device itself, next to the model name)
    + +

    Niveau de compatibilitée

    + +

    Notebooks

    + +

    Classe A (Platinium)

    + +

    Tout le matériel du notebook fonctionne avec du logiciel libre. Exemple : la 3D fonctionne, le son et la wifi également

    + +

    Classe B (Or)

    + +

    Tout le matériel du notebook fonctionne, mais avec des performances réduites. Exemple : la carte graphique est reconnues mais la 3D ne fonctionne pas

    + +

    Classe C (Argent)

    + +

    Un matériel principal ne fonctionne pas. Exemple : La carte wifi ne fonctionne pas

    + +

    Classe D (Bronze)

    + +

    Plus d'un matériel ne fonctionne pas avec du logiciel libre

    + +

    Classe E (Poubelle)

    + +

    Aucun matériel ne fonctionne avec du logiciel libre

    + + +

    Imprimantes

    + +

    Classe A (Complet)

    + +

    Toutes les fonctionnalitées de l'imprimante fonctionne avec du logiciel libre

    + +

    Classe B (Partielle)

    + +

    La fonction d'impression fonctionne, mais à une vitesse ou qualitée limitée. Le scan ou le fax sur certains appareils peut ne pas être supportés

    + +

    Classe C (Aucun)

    + +

    L'imprimante ne fonctionne pas avec du logiciel libre

    + + +

    Scanners

    + +

    Classe A (Complet)

    + +

    Toutes les fonctionnalitées du scanner sont supportées

    + +

    Classe B (Partielle)

    + +

    Le scanner fonctionne mais à une vitesse ou qualitée limitée, d'autres fonctionnalitées peuvent ne pas fonctionner

    + +

    Classe C (Aucun)

    + +

    Le scanner ne fonctionne pas avec du logiciel libre

    + +

    Découvrez votre matériel

    +
    + (Merci lluvia) +
    + +

    Pour connaitre votre matériel en détails, vous pouviez faire les choses suivantes:

    + +

    Comment découvrir le modèle de votre notebook

    + +

    See below your notebook or netbook

    + +

    Trouver la version du noyau linux libre que vous utilisez

    + +

    Ouvrez un terminal et tapez la commande suivant:

    + +
    +		uname -r
    +	
    + +

    Comment trouver le modèle de votre carte graphique

    + +

    Ouvrez un terminal et taper la commande suivante:

    + +
    +		sudo lspci
    +	
    + +

    Chercher la ligne qui contient le mot VGA ou Display Controller. Vous pouvez aussi essayer l'une des commandes suivantes:

    + +
    +		lspci | grep "Display controller"
    +	
    + +

    ou

    + +
    +		lspci | grep "VGA"
    +	
    + +

    Comment connaitre le VendorID ou le ProductID (VendorID:ProductID code)

    + +
    + (Merci à Michał Masłowski et Julius22) +
    + +

    Si le matériel est intégré (example : une puce vidéo)

    + +

    Ouvrez un terminal sudo et taper la commande suivante:

    + +
    +		sudo lspci -nnk
    +	
    + +

    Vous devriez obtenir une liste de matériel similaire à celle-ci

    + +
    +	03:00.0 Network controller [0280]: Broadcom Corporation BCM4311 802.11b/g WLAN [14e4:4311] (rev 02)
    +	Kernel driver in use: b43-pci-bridge
    +	Kernel modules: ssb
    +	05:00.0 VGA compatible controller [0300]: nVidia Corporation G86 [GeForce 8400M GS] [10de:0427] (rev a1)
    +	Kernel modules: nouveau, nvidiafb
    +	
    + +

    Les lignes en gras et placée entre crochet (dans la liste ci-dessus) sont les lignes que vous recherchez. Le premier packet de numéros (avant la virgule) sont le VendorID, le second sont le ProductID. Dans l’exemple ci dessus, le code VendorID:ProductID de la carte wifi ( vous pouvez la remarquez grace aux mots "Network Controller" et "WLAN" ) est 14e4:4311

    + +

    Si le périphérique est un périphérique USB : (exemple : une clé usb wifi)

    + +

    Ouvrez un terminal et tapez:

    + +
    +		sudo lsusb
    +	
    + +

    Vous devriez obtenir une liste de matériel similaire à celle ci

    + +
    +	Bus 001 Device 002: ID 0846:4260 NetGear, Inc. WG111v3 54 Mbps Wireless [realtek RTL8187B]
    +	Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    +	Bus 002 Device 003: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint Sensor
    +	
    + +

    Les lignes en gras (dans la liste du dessus) sont les lignes que vous recherchez. Les premiers nombres (avant les deux points) sont le VendorID, les autres sont le ProductID. Dans l'exemple ci-dessus : le code VendorID:ProductID de la carte usb wifi externe (Remarquez la ligne Wireless) est 0846:4260

    + +

    Comment savoir si votre carte graphique fonctionne

    + +

    Installer rss-glx en utilisant le gestionnaire de paquet de votre distribution ou en le compilant depuis les sources et essayez certains écran de veille (par exemple Skyrocket ou Solarwinds). Essayer de faire fonctionner le fond d'écran, et/ou le faire fonctionner fluidement.

    + +

    Comment savoir si l'accélération 3D fonctionne

    + +

    Essayer d’activer compiz

    + +

    Comment decouvrir le nom de votre carte wifi

    + +

    Ouvrez un terminal et taper la commande suivante:

    + +
    +		sudo lspci
    +	
    + +

    Regardez ensuite les lignes Wireless ou Network controller. Vous pouvez aussi essayer l'une de ses commandes:

    + +
    +		lspci | grep "Wireless" 
    +	
    + +

    ou

    + +
    +		lspci | grep "Network" 
    +	
    + +

    Comment connaitre le pilote d’imprimante que vous utilisez

    + +

    Si vous utilisez cups

    + +

    Ouvrez un terminal et taper ceci:

    + +
    +		dpkg-query -W -f '${Version}\n' cups
    +	
    + + +

    Liste de dristributions GNU/Linux entièrement libre

    + +

    They are listed in alphabetical order

    + + + +
    diff --git a/h-source/Application/Views/Help/index_it.php b/h-source/Application/Views/Help/index_it.php new file mode 100644 index 0000000..cd22c34 --- /dev/null +++ b/h-source/Application/Views/Help/index_it.php @@ -0,0 +1,378 @@ + + +. +?> + +
    + +
    + ">Home » help +
    + + + +

    Sintassi della Wiki

    + +

    Lista dei tag della wiki di

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    nometagrisultatodescrizione
    grassetto[b]text[/b]texttesto in grassetto
    corsivo[i]text[/i]texttesto corsivo
    cancellare[del]text[/del]texttesto cancellato
    sottolineare[u]text[/u]texttesto sottolineato
    head 1[h1]text[/h1]
    text
    head 1
    head 2[h2]text[/h2]
    text
    head 2
    head 3[h3]text[/h3]
    text
    head 3
    paragrafo[p]text[/p]

    text

    crea un nuovo paragrafo
    elenco[list]list[/list]<ul>list</ul>crea un elenco di item
    elenco numerato[enum]list[/enum]<ol>list</ol>crea un elenco numerato di item
    item di un elenco[*]item[/*]<li>item</li>aggiungi un item a un elenco
    codice[code]some code[/code]
    some code
    aggiungi del codice
    link semplice[a]url[/a]<a href="url">url</a>crea un link semplice
    link con testo[a]url|text[/a]<a href="url">text</a>crea un link con testo
    notebook[notebook]id[/notebook] crea un link al notebook con l'identificatore corrispondente a id (l'identificatore di ogni modello di dispositivo si trova nella pagina del dispositivo stesso, accanto al nome del modello
    wifi[wifi]id[/wifi] crea un link alla wifi con l'identificatore corrispondente a id (l'identificatore di ogni modello di dispositivo si trova nella pagina del dispositivo stesso, accanto al nome del modello)
    scheda video[videocard]id[/videocard] crea un link alla scheda video con l'identificatore corrispondente a id (l'identificatore di ogni modello di dispositivo si trova nella pagina del dispositivo stesso, accanto al nome del modello)
    + +

    Classi di compatibilità

    + +

    Notebooks

    + +

    Classe A (Platino)

    + +

    Tutti i dispositivi del portatile funzionano ad alte prestazioni. Per esempio: funzionano tutti i dispositivi, l'accelerazione 3D è supportata.

    + +

    Classe B (Oro)

    + +

    Tutti i dispositivi del portatile funzionano ma non a piene prestazioni. Esempio tipico: funzionano tutti i dispositivi, ma l'accelerazione 3D non è supportata.

    + +

    Classe C (Argento)

    + +

    Uno dei dispositivi principali non è supportato. Per esempio: la scheda wifi interna non funziona e serve una wifi esterna USB.

    + +

    Classe D (Bronzo)

    + +

    Più di uno dei dispositivi principali non è supportato.

    + +

    Classe E (Spazzatura)

    + +

    Il portatile non funziona con software libero.

    + + +

    Stampanti

    + + +

    Classe A (Piena)

    + +

    Sono supportate tutte le funzioni e le caratteristiche della stampante.

    + +

    Classe B (Parziale)

    + +

    La funzione di stampa è supportata, ma a velocità limitata o a scarsa qualità. Su alcune stampanti multifunzione possono non essere supportate le funzioni di scanner e/o di fax.

    + +

    Classe C (Nessuna)

    + +

    La stampante non funziona con software libero.

    + + +

    Scanner

    + +

    Classe A (Piena)

    + +

    Sono supportate tutte le funzioni e le caratteristiche dello scanner.

    + +

    Classe B (Parziale)

    + +

    La funzione di scannerizzazione è supportata, ma a velocità limitata o a scarsa qualità. Qualche altra caratteristica può non essere supportata.

    + +

    Classe C (Nessuna)

    + +

    Lo scanner non funziona con software libero.

    + +

    Scopri il tuo hardware

    +
    + (Grazie lluvia) +
    + +

    Per sapere le caratteristiche e i dettagli del tuo hardware puoi seguire queste istruzioni:

    + +

    Come scoprire il nome del modello del portatile

    + +

    Guarda sotto al tuo notebook o al tuo netbook

    + +

    Come scoprire che versione del kernel libre stai usando

    + +

    Apri un terminale e digita questo comando:

    + +
    +        uname -r
    +    
    + +

    Come scoprire il nome della tua scheda video

    + +

    Apri un terminale e digita questo comando:

    + + +
    +        sudo lspci
    +    
    + +

    Poi cerca la riga contenente la stringa VGA o Display controller. Puoi anche provare con uno di questi comandi:

    + +
    +        lspci | grep "Display controller"
    +    
    + + +

    o

    + +
    +        lspci | grep "VGA"
    +    
    + +

    Come scoprire il VendorID e il ProductID del tuo dispositivo (VendorID:ProductID code)

    + +
    + (Grazie Michał Masłowski e Julius22) +
    + +

    Se il dispositivo è integrato (per esempio una scheda video)

    + +

    Apri un terminale e digita il seguente comando:

    + +
    +        sudo lspci -nnk
    +    
    + +

    Dovresti ottenere una lista di hardware simile a quella scritta qui sotto

    + +
    +
    +    03:00.0 Network controller [0280]: Broadcom Corporation BCM4311 802.11b/g WLAN [14e4:4311] (rev 02)
    +    Kernel driver in use: b43-pci-bridge
    +    Kernel modules: ssb
    +    05:00.0 VGA compatible controller [0300]: nVidia Corporation G86 [GeForce 8400M GS] [10de:0427] (rev a1)
    +    Kernel modules: nouveau, nvidiafb
    +    
    + +

    Le stringhe in grassetto e tra parentesi quadre (nella lista qui sopra) sono il codice che stai cercando. Il primo gruppo di cifre (prima dei due punti) è il VendorID, il secondo gruppo è il ProductID. Nell'esempio qui sopra: il codice VendorID:ProductID della scheda wifi (nota le stringhe "Network controller" e "WLAN") è 14e4:4311 mentre il codice VendorID:ProductID della scheda video (nota la stringa "VGA") è 10de:0427

    + + +

    Se si tratta di un dispositivo USB (per esempio una wifi esterna USB)

    + +

    Apri un terminale e digita questo comando:

    + +
    +        sudo lsusb
    +    
    + +

    Dovresti ottenere una lista di hardware simile a quella scritta qui sotto

    + +
    +
    +    Bus 001 Device 002: ID 0846:4260 NetGear, Inc. WG111v3 54 Mbps Wireless [realtek RTL8187B]
    +    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    +    Bus 002 Device 003: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint Sensor
    +    
    + +

    Le stringhe in grassetto (nella lista qui sopra) sono il codice che stai cercando. Il primo gruppo di cifre (prima dei due punti) è il VendorID, il secondo gruppo è il ProductID. Nell'esempio qui sopra: il codice VendorID:ProductID della wifi esterna USB (nota la stringa "Wireless") è 0846:4260

    + +

    Come scoprire se funziona la scheda video

    + +

    Installa rss-glx tramite il gestore di pacchetti della tua distribuzione +o compilando dai sorgenti e prova degli screensaver (per esempio Skyrocket o Solarwinds). Controlla se parte lo screensaver (e/o se si vede "fluido")

    + +

    Come scoprire se funziona l'accelerazione 3D

    + + +

    Prova ad attivare compiz

    + +

    Come scoprire il nome della tua scheda wifi

    + +

    Apri un terminale e digita questo comando:

    + +
    +        sudo lspci
    +    
    + +

    Poi cerca la riga contenente la stringa Wireless o Network controller. Puoi anche provare uno dei seguenti comandi:

    + + +
    +        lspci | grep "Wireless"
    +    
    + +

    o

    + +
    +        lspci | grep "Network"
    +    
    + +

    Come scoprire che driver per la stampante stai usando

    + +

    Se stai usando cups

    + +

    Apri un terminale e digita il seguente comando:

    + +
    +        dpkg-query -W -f '${Version}\n' cups
    +    
    + + +

    Lista di distribuzioni GNU/Linux completamente libere

    + +

    In ordine alfabetico

    + + + +
    diff --git a/h-source/Application/Views/History/viewall.php b/h-source/Application/Views/History/viewall.php new file mode 100644 index 0000000..47848ff --- /dev/null +++ b/h-source/Application/Views/History/viewall.php @@ -0,0 +1,38 @@ + + +. +?> + + + +
    +
    this message has been by getUser($row['history']['created_by']));?> at with the following motivation: +
    +
    +
    + + + +
    + there are no details.. +
    + \ No newline at end of file diff --git a/h-source/Application/Views/Home/left.php b/h-source/Application/Views/Home/left.php new file mode 100644 index 0000000..816a47b --- /dev/null +++ b/h-source/Application/Views/Home/left.php @@ -0,0 +1,34 @@ + + +. +?> + +
    + +
    + Home +
    + + + +

    it works!!

    + +

    modify the file Application/Views/Home/left.php in order to change the english version of your homepage

    + +

    modify the file Application/Include/languages.php in order to add new languages

    +
    diff --git a/h-source/Application/Views/Home/left_es.php b/h-source/Application/Views/Home/left_es.php new file mode 100644 index 0000000..029962b --- /dev/null +++ b/h-source/Application/Views/Home/left_es.php @@ -0,0 +1,31 @@ + + +. +?> + +
    + +
    + Home +
    + + + + + +
    diff --git a/h-source/Application/Views/Home/left_fr.php b/h-source/Application/Views/Home/left_fr.php new file mode 100644 index 0000000..de2acda --- /dev/null +++ b/h-source/Application/Views/Home/left_fr.php @@ -0,0 +1,30 @@ + + +. +?> + +
    + +
    + Home +
    + + + + +
    diff --git a/h-source/Application/Views/Home/left_it.php b/h-source/Application/Views/Home/left_it.php new file mode 100644 index 0000000..de2acda --- /dev/null +++ b/h-source/Application/Views/Home/left_it.php @@ -0,0 +1,30 @@ + + +. +?> + +
    + +
    + Home +
    + + + + +
    diff --git a/h-source/Application/Views/Issues/view.php b/h-source/Application/Views/Issues/view.php new file mode 100644 index 0000000..20d0403 --- /dev/null +++ b/h-source/Application/Views/Issues/view.php @@ -0,0 +1,202 @@ + + +. +?> + + + +
    + + + +
    + + +
    + +
    + +
    + submitted by getUser($row['issues']['created_by']));?>, +
    + +
    + + + + + + + + + + + + + +
    :
    :
    :
    +
    + +
    + : +
    + +
    + +
    + + + +
    + Response message (from h-node.com): +
    + +
    + +
    + + + + +
    + + +
    +
    + : +
    + + + + +
    +
    +
    + getUser($row['messages']['created_by']);?>: +
    + + ">hide + + +
    + +
    + +
    +
    + submitted by getUser($row['messages']['created_by']));?>, +
    + + + +
    +
    message
    + ">view details +
    +
    + + +
    + + + +
    + + + ">make visible + + +
    +
    message
    + + ">view details + +
    +
    +
    + submitted by getUser($row['messages']['created_by']));?>, +
    +
    + +
    +
    +
    +
    +
    + + +
    + + + + + + + .. + + +
    + + + + +
    +
    + +
    + + + + + +
    + : +
    +
    +
    + +
    +
    + + + +
    + + + + + + + +
    \ No newline at end of file diff --git a/h-source/Application/Views/Issues/viewall.php b/h-source/Application/Views/Issues/viewall.php new file mode 100644 index 0000000..39bd566 --- /dev/null +++ b/h-source/Application/Views/Issues/viewall.php @@ -0,0 +1,118 @@ + + +. +?> + + + +
    + +
    + ">Home » issues +
    + +
    +
    + : +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ID
    viewStatus;?>">getUser($row['issues']['created_by']));?> + +
    +
    + +
    + : +
    + + + +
    +
    + +
    + + + + + +
    + : +
    +
    +
    + +
    +
    + + + +
    + + + + + + + +
    \ No newline at end of file diff --git a/h-source/Application/Views/My/email.php b/h-source/Application/Views/My/email.php new file mode 100644 index 0000000..bda793e --- /dev/null +++ b/h-source/Application/Views/My/email.php @@ -0,0 +1,31 @@ + + +. +?> + +
    + +
    + ">Home » ">panel » e-mail +
    + + + + + +
    \ No newline at end of file diff --git a/h-source/Application/Views/My/goodbye.php b/h-source/Application/Views/My/goodbye.php new file mode 100644 index 0000000..e4936a6 --- /dev/null +++ b/h-source/Application/Views/My/goodbye.php @@ -0,0 +1,61 @@ + + +. +?> + + + +
    + +
    + ">Home » ">panel » delete account +
    + + + +
    + +
    viewStatus;?>" method="POST"> + I want to close my account: +
    + +
    + +
    \ No newline at end of file diff --git a/h-source/Application/Views/My/panel.php b/h-source/Application/Views/My/panel.php new file mode 100644 index 0000000..d03d274 --- /dev/null +++ b/h-source/Application/Views/My/panel.php @@ -0,0 +1,35 @@ + + +. +?> + + \ No newline at end of file diff --git a/h-source/Application/Views/My/password.php b/h-source/Application/Views/My/password.php new file mode 100644 index 0000000..1644b88 --- /dev/null +++ b/h-source/Application/Views/My/password.php @@ -0,0 +1,31 @@ + + +. +?> + +
    + +
    + ">Home » ">panel » password +
    + + + + + +
    \ No newline at end of file diff --git a/h-source/Application/Views/My/profile.php b/h-source/Application/Views/My/profile.php new file mode 100644 index 0000000..b4f51ea --- /dev/null +++ b/h-source/Application/Views/My/profile.php @@ -0,0 +1,31 @@ + + +. +?> + +
    + +
    + ">Home » ">panel » profile +
    + + + + + +
    \ No newline at end of file diff --git a/h-source/Application/Views/News/index.php b/h-source/Application/Views/News/index.php new file mode 100644 index 0000000..ce2b080 --- /dev/null +++ b/h-source/Application/Views/News/index.php @@ -0,0 +1,49 @@ + + +. +?> + +
    + +
    + ">Home » news +
    + +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + 10) { ?> +
    + +
    + + +
    diff --git a/h-source/Application/Views/Notebooks/catalogue.php b/h-source/Application/Views/Notebooks/catalogue.php new file mode 100644 index 0000000..b4c24ce --- /dev/null +++ b/h-source/Application/Views/Notebooks/catalogue.php @@ -0,0 +1,80 @@ + + +. +?> + +
    +
    + +
    +
    +
    viewArgs['vendor']?>
    +
    viewArgs['compatibility']?>
    +
    viewArgs['comm_year']?>
    +
    viewArgs['subtype']?>
    +
    viewArgs['sort-by']?>
    +
    +
    + + + +
    + .. +
    + + + + +
    + +
    + ">: +
    + +
    +
    :
    +
    +
    + +
    +
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + + + +
    + + + +
    + : +
    + \ No newline at end of file diff --git a/h-source/Application/Views/Notebooks/form.php b/h-source/Application/Views/Notebooks/form.php new file mode 100644 index 0000000..0ef7d1b --- /dev/null +++ b/h-source/Application/Views/Notebooks/form.php @@ -0,0 +1,114 @@ + + +. +?> + + + + + +
    +
    action."/$lang/$token".$this->viewStatus;?>" method="POST"> + +
    + +
    + + + ">Vendor not present? +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + + +
    + +
    + + + "> +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + + + + + +
    + * are mandatory");?> +
    + +
    + +
    +
    \ No newline at end of file diff --git a/h-source/Application/Views/Notebooks/page.php b/h-source/Application/Views/Notebooks/page.php new file mode 100644 index 0000000..0a29b3d --- /dev/null +++ b/h-source/Application/Views/Notebooks/page.php @@ -0,0 +1,92 @@ + + +. +?> + + + + action,'view') === 0) ? 'hardware' : 'revisions'; + ?> + + +
    + + + action,'revision') === 0) { ?> +
    + This is an old revision of this page, as edited by getUser($updated_by));?> at . It may differ significantly from the viewStatus;?>">current revision. +
    + + +
    + "> : (: ) + action,'view') === 0) { ?> + ask for removal + +
    + +
    +
    :
    +
    +
    + +
    +
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    + +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    ()
    +
    + +
    +
    :
    +
    ()
    +
    + +
    +
    :
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/h-source/Application/Views/Printers/catalogue.php b/h-source/Application/Views/Printers/catalogue.php new file mode 100644 index 0000000..bf790f0 --- /dev/null +++ b/h-source/Application/Views/Printers/catalogue.php @@ -0,0 +1,80 @@ + + +. +?> + +
    +
    + +
    +
    +
    viewArgs['vendor']?>
    +
    viewArgs['compatibility']?>
    +
    viewArgs['comm_year']?>
    +
    viewArgs['interface']?>
    +
    viewArgs['sort-by']?>
    +
    +
    + + + +
    + .. +
    + + + + + + + + +
    + : +
    + \ No newline at end of file diff --git a/h-source/Application/Views/Printers/form.php b/h-source/Application/Views/Printers/form.php new file mode 100644 index 0000000..b6a71a6 --- /dev/null +++ b/h-source/Application/Views/Printers/form.php @@ -0,0 +1,104 @@ + + +. +?> + + + + + +
    +
    controller."/".$this->action."/$lang/$token".$this->viewStatus;?>" method="POST"> + +
    + +
    + + + ">Vendor not present? +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + + +
    + +
    + + + "> +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + + + + + +
    + * are mandatory");?> +
    + +
    + +
    +
    \ No newline at end of file diff --git a/h-source/Application/Views/Printers/page.php b/h-source/Application/Views/Printers/page.php new file mode 100644 index 0000000..100cfde --- /dev/null +++ b/h-source/Application/Views/Printers/page.php @@ -0,0 +1,92 @@ + + +. +?> + + + + action,'view') === 0) ? 'hardware' : 'revisions'; + ?> + + +
    + + + action,'revision') === 0) { ?> +
    + This is an old revision of this page, as edited by getUser($updated_by));?> at . It may differ significantly from the controller."/view/$lang/$id_hard/".$name.$this->viewStatus;?>">current revision. +
    + + +
    + "> : (: ) + action,'view') === 0) { ?> + ask for removal + +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    + +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/h-source/Application/Views/Project/index.php b/h-source/Application/Views/Project/index.php new file mode 100644 index 0000000..7b8140c --- /dev/null +++ b/h-source/Application/Views/Project/index.php @@ -0,0 +1,29 @@ + + +. +?> + +
    + +
    + ">Home » h-project +
    + +

    write in the file Application/Views/Project/index.php your project information

    + +
    diff --git a/h-source/Application/Views/Project/index_es.php b/h-source/Application/Views/Project/index_es.php new file mode 100644 index 0000000..f934b0f --- /dev/null +++ b/h-source/Application/Views/Project/index_es.php @@ -0,0 +1,29 @@ + + +. +?> + +
    + +
    + ">Home » h-project +
    + + + +
    diff --git a/h-source/Application/Views/Project/index_it.php b/h-source/Application/Views/Project/index_it.php new file mode 100644 index 0000000..f934b0f --- /dev/null +++ b/h-source/Application/Views/Project/index_it.php @@ -0,0 +1,29 @@ + + +. +?> + +
    + +
    + ">Home » h-project +
    + + + +
    diff --git a/h-source/Application/Views/Scanners/catalogue.php b/h-source/Application/Views/Scanners/catalogue.php new file mode 100644 index 0000000..c988371 --- /dev/null +++ b/h-source/Application/Views/Scanners/catalogue.php @@ -0,0 +1,80 @@ + + +. +?> + +
    +
    + +
    +
    +
    viewArgs['vendor']?>
    +
    viewArgs['compatibility']?>
    +
    viewArgs['comm_year']?>
    +
    viewArgs['interface']?>
    +
    viewArgs['sort-by']?>
    +
    +
    + + + +
    + ... +
    + + + + + + + + +
    + : +
    + \ No newline at end of file diff --git a/h-source/Application/Views/Scanners/form.php b/h-source/Application/Views/Scanners/form.php new file mode 100644 index 0000000..78f8bcb --- /dev/null +++ b/h-source/Application/Views/Scanners/form.php @@ -0,0 +1,104 @@ + + +. +?> + + + + + +
    +
    controller."/".$this->action."/$lang/$token".$this->viewStatus;?>" method="POST"> + +
    + +
    + + + ">Vendor not present? +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + + +
    + +
    + + + "> +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + + + + + +
    + * are mandatory");?> +
    + +
    + +
    +
    \ No newline at end of file diff --git a/h-source/Application/Views/Scanners/page.php b/h-source/Application/Views/Scanners/page.php new file mode 100644 index 0000000..411fe6d --- /dev/null +++ b/h-source/Application/Views/Scanners/page.php @@ -0,0 +1,92 @@ + + +. +?> + + + + action,'view') === 0) ? 'hardware' : 'revisions'; + ?> + + +
    + + + action,'revision') === 0) { ?> +
    + This is an old revision of this page, as edited by getUser($updated_by));?> at . It may differ significantly from the controller."/view/$lang/$id_hard/".$name.$this->viewStatus;?>">current revision. +
    + + +
    + "> : (: ) + action,'view') === 0) { ?> + ask for removal + +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    + +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/h-source/Application/Views/Search/form.php b/h-source/Application/Views/Search/form.php new file mode 100644 index 0000000..ab25d9e --- /dev/null +++ b/h-source/Application/Views/Search/form.php @@ -0,0 +1,72 @@ + + +. +?> + + + +
    + +
    + ">Home » search form +
    + +
    + Search one device in the archive: +
    + +
    + + +
    + + + + + + + + + +
    hardware type:
    the model name contains:
    +
    + + +
    + +
    diff --git a/h-source/Application/Views/Search/form_es.php b/h-source/Application/Views/Search/form_es.php new file mode 100644 index 0000000..f58a125 --- /dev/null +++ b/h-source/Application/Views/Search/form_es.php @@ -0,0 +1,72 @@ + + +. +?> + + + +
    + +
    + ">Home » search form +
    + +
    + Busque un dispositivo en el archivo:: +
    + +
    + + +
    + + + + + + + + + +
    tipo de hardware:
    el nombre del modelo contiene:
    +
    + + +
    + +
    diff --git a/h-source/Application/Views/Search/form_it.php b/h-source/Application/Views/Search/form_it.php new file mode 100644 index 0000000..4d89477 --- /dev/null +++ b/h-source/Application/Views/Search/form_it.php @@ -0,0 +1,72 @@ + + +. +?> + + + +
    + +
    + ">Home » search form +
    + +
    + Cerca un dispositivo nell'archivio: +
    + +
    + + +
    + + + + + + + + + +
    tipo di hardware:
    il nome del modello contiene:
    +
    + + +
    + +
    diff --git a/h-source/Application/Views/Search/results.php b/h-source/Application/Views/Search/results.php new file mode 100644 index 0000000..48c4f8b --- /dev/null +++ b/h-source/Application/Views/Search/results.php @@ -0,0 +1,66 @@ + + +. +?> + +
    + +
    + ">Home » ">search form » results +
    + +
    + : +
    + +
    + + +
    +
    + : "> +
    +
    + : +
    +
    + : +
    +
    + + + + +
    + .. +
    + + +
    + + +
    + : +
    + + +
    diff --git a/h-source/Application/Views/Users/add.php b/h-source/Application/Views/Users/add.php new file mode 100755 index 0000000..0b8aabc --- /dev/null +++ b/h-source/Application/Views/Users/add.php @@ -0,0 +1,70 @@ + + +. +?> + +
    + +
    + ">Home » create account +
    + + + + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + +
    + +
    + + +
    + +
    + +
    + +
    + +
    \ No newline at end of file diff --git a/h-source/Application/Views/Users/change.php b/h-source/Application/Views/Users/change.php new file mode 100644 index 0000000..623d647 --- /dev/null +++ b/h-source/Application/Views/Users/change.php @@ -0,0 +1,28 @@ + + +. +?> + +
    + +
    +

    The link has expired

    +

    go to the ">homepage

    +
    + +
    \ No newline at end of file diff --git a/h-source/Application/Views/Users/confirmation.php b/h-source/Application/Views/Users/confirmation.php new file mode 100644 index 0000000..f1a2074 --- /dev/null +++ b/h-source/Application/Views/Users/confirmation.php @@ -0,0 +1,42 @@ + + +. +?> + +
    + +
    + ">Home » confirmation +
    + + + +
    +

    The account has been confirmed successfully!

    +

    go to the ">homepage

    +
    + + + +
    +

    The confirmation link has expired

    +

    go to the ">homepage

    +
    + + +
    \ No newline at end of file diff --git a/h-source/Application/Views/Users/contributions.php b/h-source/Application/Views/Users/contributions.php new file mode 100644 index 0000000..2d5995a --- /dev/null +++ b/h-source/Application/Views/Users/contributions.php @@ -0,0 +1,50 @@ + + +. +?> + +
    + +
    + ">Home » ">meet » contributions +
    + +
    + contributions of +
    + +
    + +
    + +
    + + "> +
    + +
    + +
    + +
    \ No newline at end of file diff --git a/h-source/Application/Views/Users/forgot.php b/h-source/Application/Views/Users/forgot.php new file mode 100644 index 0000000..a4c7d20 --- /dev/null +++ b/h-source/Application/Views/Users/forgot.php @@ -0,0 +1,55 @@ + + +. +?> + +
    + +
    + ">Home » request new password +
    + + + + + +
    + +
    + + +
    + +
    + +
    + +
    + + +
    + +
    + +
    + +
    + +
    \ No newline at end of file diff --git a/h-source/Application/Views/Users/login.php b/h-source/Application/Views/Users/login.php new file mode 100755 index 0000000..5998751 --- /dev/null +++ b/h-source/Application/Views/Users/login.php @@ -0,0 +1,57 @@ + + +. +?> + + + + + + + + + + + + + + + + diff --git a/h-source/Application/Views/Users/logout.php b/h-source/Application/Views/Users/logout.php new file mode 100755 index 0000000..39b5873 --- /dev/null +++ b/h-source/Application/Views/Users/logout.php @@ -0,0 +1,25 @@ + + +. +?> + +
    +
    + +
    ">login
    +
    \ No newline at end of file diff --git a/h-source/Application/Views/Users/meet.php b/h-source/Application/Views/Users/meet.php new file mode 100644 index 0000000..ee0c708 --- /dev/null +++ b/h-source/Application/Views/Users/meet.php @@ -0,0 +1,89 @@ + + +. +?> + +
    + +
    + ">Home » meet +
    + + + + +
    + +
    +
    Username:
    +
    + + +
    +
    My website:
    +
    + + + +
    +
    My real name is:
    +
    + + + +
    +
    My e-mail address:
    +
    + + + +
    +
    I'm from:
    +
    + + + +
    +
    Birthdate:
    +
    + + + +
    +
    My favourite distro is:
    +
    + + + +
    +
    Projects I'm working on:
    +
    + + + +
    +
    My description:
    +
    + + +
    + + +
    \ No newline at end of file diff --git a/h-source/Application/Views/Users/notice.php b/h-source/Application/Views/Users/notice.php new file mode 100644 index 0000000..d556363 --- /dev/null +++ b/h-source/Application/Views/Users/notice.php @@ -0,0 +1,94 @@ + + +. +?> + +
    + +
    + ">Home » notice +
    + + + + +
    +

    An e-mail has been sent to your mailbox.

    +

    If you have received no mail, then check inside the spam too

    +

    Click on the confirmation link in the e-mail in order to confirm the registration of the new account.

    +

    The confirmation link will expire in a hour.

    +

    If you don't want to confirm the account registration then wait one hour and your username and e-mail will be deleted from the database.

    +

    go to the ">homepage

    +
    + + + +
    +

    Registration failed

    +

    go to the ">homepage

    +
    + + + +
    +

    An e-mail has been sent to your mailbox.

    +

    If you have received no mail, then check inside the spam too

    +

    Click on the confirmation link in the e-mail in order to change the password of your account.

    +

    The confirmation link will expire in a hour.

    +

    go to the ">homepage

    +
    + + + +
    +

    Registration failed

    +

    go to the ">homepage

    +
    + + + +
    +

    The new password has been sent to you by mail!

    +

    If you have received no mail, then check inside the spam too

    +

    go to the ">homepage

    +
    + + + +
    +

    Operation failed

    +

    go to the ">homepage

    +
    + + + +
    +

    Your account has been successfully deleted

    +

    go to the ">homepage

    +
    + + + + + +
    +

    go to the ">homepage

    +
    + + +
    \ No newline at end of file diff --git a/h-source/Application/Views/Videocards/catalogue.php b/h-source/Application/Views/Videocards/catalogue.php new file mode 100644 index 0000000..0fbe2be --- /dev/null +++ b/h-source/Application/Views/Videocards/catalogue.php @@ -0,0 +1,79 @@ + + +. +?> + +
    +
    + +
    +
    +
    viewArgs['vendor']?>
    +
    viewArgs['comm_year']?>
    +
    viewArgs['interface']?>
    +
    viewArgs['sort-by']?>
    +
    +
    + + + +
    + .. +
    + + + + + + + + +
    + : +
    + \ No newline at end of file diff --git a/h-source/Application/Views/Videocards/form.php b/h-source/Application/Views/Videocards/form.php new file mode 100644 index 0000000..25f33b7 --- /dev/null +++ b/h-source/Application/Views/Videocards/form.php @@ -0,0 +1,98 @@ + + +. +?> + + + + + +
    +
    controller."/".$this->action."/$lang/$token".$this->viewStatus;?>" method="POST"> + +
    + +
    + + + ">Vendor not present? +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + + + + + +
    + * are mandatory");?> +
    + +
    + +
    +
    \ No newline at end of file diff --git a/h-source/Application/Views/Videocards/page.php b/h-source/Application/Views/Videocards/page.php new file mode 100644 index 0000000..5ae071c --- /dev/null +++ b/h-source/Application/Views/Videocards/page.php @@ -0,0 +1,87 @@ + + +. +?> + + + + action,'view') === 0) ? 'hardware' : 'revisions'; + ?> + + +
    + + + action,'revision') === 0) { ?> +
    + This is an old revision of this page, as edited by getUser($updated_by));?> at . It may differ significantly from the controller."/view/$lang/$id_hard/".$name.$this->viewStatus;?>">current revision. +
    + + +
    + "> : (: ) + action,'view') === 0) { ?> + ask for removal + +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    +
    +
    + +
    +
    :
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/h-source/Application/Views/Wifi/catalogue.php b/h-source/Application/Views/Wifi/catalogue.php new file mode 100644 index 0000000..df03820 --- /dev/null +++ b/h-source/Application/Views/Wifi/catalogue.php @@ -0,0 +1,80 @@ + + +. +?> + +
    +
    + +
    +
    +
    viewArgs['vendor']?>
    +
    viewArgs['comm_year']?>
    +
    viewArgs['wifi_works']?>
    +
    viewArgs['interface']?>
    +
    viewArgs['sort-by']?>
    +
    +
    + + + +
    + .. +
    + + + + + + + + +
    + : +
    + \ No newline at end of file diff --git a/h-source/Application/Views/Wifi/form.php b/h-source/Application/Views/Wifi/form.php new file mode 100644 index 0000000..c955d26 --- /dev/null +++ b/h-source/Application/Views/Wifi/form.php @@ -0,0 +1,98 @@ + + +. +?> + + + + + +
    +
    controller."/".$this->action."/$lang/$token".$this->viewStatus;?>" method="POST"> + +
    + +
    + + + ">Vendor not present? +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + + + + + +
    + * are mandatory");?> +
    + +
    + +
    +
    \ No newline at end of file diff --git a/h-source/Application/Views/Wifi/page.php b/h-source/Application/Views/Wifi/page.php new file mode 100644 index 0000000..40696dc --- /dev/null +++ b/h-source/Application/Views/Wifi/page.php @@ -0,0 +1,87 @@ + + +. +?> + + + + action,'view') === 0) ? 'hardware' : 'revisions'; + ?> + + +
    + + + action,'revision') === 0) { ?> +
    + This is an old revision of this page, as edited by getUser($updated_by));?> at . It may differ significantly from the controller."/view/$lang/$id_hard/".$name.$this->viewStatus;?>">current revision. +
    + + +
    + "> : (: ) + action,'view') === 0) { ?> + ask for removal + +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    :
    +
    +
    + +
    +
    +
    +
    + +
    +
    :
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/h-source/Application/Views/bottom_left.php b/h-source/Application/Views/bottom_left.php new file mode 100644 index 0000000..438fe0f --- /dev/null +++ b/h-source/Application/Views/bottom_left.php @@ -0,0 +1,27 @@ + + +. +?> + + action,'talk') !== 0) { ?> +
    + The contents of this page are in the Public Domain. (see the CC0 page for detailed information). Anyone is free to copy, modify, publish, use, sell, or distribute the text for any purpose, commercial or non-commercial, and by any means. +
    + + +
    \ No newline at end of file diff --git a/h-source/Application/Views/climb.php b/h-source/Application/Views/climb.php new file mode 100644 index 0000000..f947cd5 --- /dev/null +++ b/h-source/Application/Views/climb.php @@ -0,0 +1,35 @@ + + +. +?> + +
    + + + +
    + + +
    viewStatus;?>" method="POST"> + I want to make this revision the current revision: +
    + + +
    + +
    \ No newline at end of file diff --git a/h-source/Application/Views/dialog.php b/h-source/Application/Views/dialog.php new file mode 100644 index 0000000..537e527 --- /dev/null +++ b/h-source/Application/Views/dialog.php @@ -0,0 +1,100 @@ + + +. +?> + + + + +
    + +
    + + + + + + + + + + + + + + +
    +
    +
    + +
    +
    + +
    +
    \ No newline at end of file diff --git a/h-source/Application/Views/differences.php b/h-source/Application/Views/differences.php new file mode 100644 index 0000000..7e3862e --- /dev/null +++ b/h-source/Application/Views/differences.php @@ -0,0 +1,43 @@ + + +. +?> + +
    + +
    + Notice: the text in red has been deleted from the previous revision, the text in green has been added in this revision and the text in gray has not been changed. +
    + + $text) { ?> + +
    + +
    + : +
    + +
    + +
    + +
    + + + +
    diff --git a/h-source/Application/Views/footer.php b/h-source/Application/Views/footer.php new file mode 100644 index 0000000..aeadbe1 --- /dev/null +++ b/h-source/Application/Views/footer.php @@ -0,0 +1,38 @@ + + +. +?> + + + + + + + diff --git a/h-source/Application/Views/header.php b/h-source/Application/Views/header.php new file mode 100644 index 0000000..83aa59d --- /dev/null +++ b/h-source/Application/Views/header.php @@ -0,0 +1,78 @@ + + +. +?> + + + + + <?php echo $title;?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + +
    diff --git a/h-source/Application/Views/history.php b/h-source/Application/Views/history.php new file mode 100644 index 0000000..4edd41b --- /dev/null +++ b/h-source/Application/Views/history.php @@ -0,0 +1,53 @@ + + +. +?> + +
    + + + +
    + +
    + page list: +
    \ No newline at end of file diff --git a/h-source/Application/Views/if_page_deleted.php b/h-source/Application/Views/if_page_deleted.php new file mode 100644 index 0000000..2f9fd1e --- /dev/null +++ b/h-source/Application/Views/if_page_deleted.php @@ -0,0 +1,49 @@ + + +. +?> + + + +
    +
    +
    + This page has been deleted as requested by: + + getUser($user));?> + +
    +
    +
    + With the following motivations: +
    +
    + +
    +
    + motivation of getUser($row['deletion']['created_by']));?>: controller);?> +
    +
    + message: +
    +
    + +
    +
    + + \ No newline at end of file diff --git a/h-source/Application/Views/license_notice.php b/h-source/Application/Views/license_notice.php new file mode 100644 index 0000000..71b1db9 --- /dev/null +++ b/h-source/Application/Views/license_notice.php @@ -0,0 +1,24 @@ + + +. +?> + +
    +
    License Informations:
    + Any text submitted by you will be put in the Public Domain (see the CC0 page for detailed information). +
    \ No newline at end of file diff --git a/h-source/Application/Views/moderator_dialog.php b/h-source/Application/Views/moderator_dialog.php new file mode 100644 index 0000000..058cc3a --- /dev/null +++ b/h-source/Application/Views/moderator_dialog.php @@ -0,0 +1,62 @@ + + +. +?> + +
    +
    +

    Write below your motivation

    + +
    +
    + +
    +
    + +
    +
    + + \ No newline at end of file diff --git a/h-source/Application/Views/right.php b/h-source/Application/Views/right.php new file mode 100644 index 0000000..9d778b2 --- /dev/null +++ b/h-source/Application/Views/right.php @@ -0,0 +1,118 @@ + + +. +?> + + \ No newline at end of file diff --git a/h-source/Application/Views/suggest_dialog.php b/h-source/Application/Views/suggest_dialog.php new file mode 100644 index 0000000..223bbd8 --- /dev/null +++ b/h-source/Application/Views/suggest_dialog.php @@ -0,0 +1,41 @@ + + +. +?> + + + +
    +

    Thanks for helping the h-node project and the free software movement!

    +

    You have just inserted a new notebook in the database.. can you please insert its devices separately too? Thanks!

    +
    \ No newline at end of file diff --git a/h-source/Application/Views/talk.php b/h-source/Application/Views/talk.php new file mode 100644 index 0000000..6ae3bca --- /dev/null +++ b/h-source/Application/Views/talk.php @@ -0,0 +1,140 @@ + + +. +?> + + + +
    + + + + + +
    + +
    + + ">hide + + +
    + +
    + +
    + by getUser($message['talk']['created_by']));?>, +
    +
    + +
    + +
    + + + +
    +
    talk
    + ">view details +
    +
    + + +
    + + + +
    + this message has been deleted + + ">make visible + + +
    +
    talk
    + + ">view details + +
    +
    +
    + submitted by getUser($message['talk']['created_by']));?>, +
    +
    + +
    +
    +
    +
    +
    + + +
    + + + + +
    + + + +
    + + + + +
    +
    controller."/talk/$lang/$id_hard/$token".$this->viewStatus;?>#form" method="POST"> + +
    + +
    + + +
    + +
    + + +
    + + + +
    + +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/h-source/Application/Views/top_left.php b/h-source/Application/Views/top_left.php new file mode 100644 index 0000000..3c7bede --- /dev/null +++ b/h-source/Application/Views/top_left.php @@ -0,0 +1,142 @@ + + +. +?> + +
    + +
    + ">Home » ">Hardware » +
    + + action,'view') === 0) { ?> + +
    + Specifications of the controller]['element'];?> +
    + + + + + + action,'catalogue') === 0) { ?> + +
    + List of controller]['element'];?>s in the archive +
    + + + + action,'history') === 0) { ?> + +
    + History of the controller]['element'].' '.$ne_name.'';?> +
    + + + + action,'differences') === 0) { ?> + + +
    + Differences between the revision of , created by getUser($updated_by));?>, and the revision of +
    + + + + + action,'climb') === 0) { ?> + +
    + Make current this revision of the controller]['element'].' '.$ne_name.'';?> +
    + + + + action,'revision') === 0) { ?> + +
    + Revision of the controller]['element'].' '.$ne_name.'';?> +
    + + + + action,'insert') === 0) { ?> + +
    + Insert a new controller]['element'];?> +
    + + + + action,'update') === 0) { ?> + +
    + Edit the controller]['element'].' '.$ne_name.'';?> +
    + + + + action,'talk') === 0) { ?> + +
    + Talk page of the controller]['element'].' '.$ne_name.'';?> +
    + + + + \ No newline at end of file diff --git a/h-source/Application/index.html b/h-source/Application/index.html new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/h-source/Application/index.html @@ -0,0 +1 @@ + -- cgit v1.2.3