diff --git a/Not working Asset code/assetdetails.php b/Not working Asset code/assetdetails.php deleted file mode 100644 index 167fb61f..00000000 --- a/Not working Asset code/assetdetails.php +++ /dev/null @@ -1,240 +0,0 @@ -load->model('assetdetails_model'); - $this->isLoggedIn(); - } - /** - * This function used to load the first screen of the user - */ - public function index() - { - $this->global['pageTitle'] = 'Siddharth : Asset Details'; - - $this->loadViews("assetlisting", $this->global, NULL , NULL); - } - - /** - * This function is used to load the Supplier list - */ - function assetListing() - { - if($this->isAdmin() == TRUE) - { - $this->loadThis(); - } - else - { - $this->load->model('assetdetails_model'); - - $searchText = $this->input->post('searchText'); - $data['searchText'] = $searchText; - - $this->load->library('pagination'); - - $count = $this->assetdetails_model->assetListingCount($searchText); - - $returns = $this->paginationCompress ( "assetListing/", $count, 5 ); - - $data['userRecords'] = $this->assetdetails_model->assetListing($searchText, $returns["page"], $returns["segment"]); - - $this->global['pageTitle'] = 'Siddharth : Cost Listing'; - - $this->loadViews("costListing", $this->global, $data, NULL); - } - } - /** - * This function is used to load the add new supplier */ - function addasset() - { - if($this->isAdmin() == TRUE) - { - $this->loadThis(); - } - else - { - $this->load->model('supplier_model'); - //$data['SupplierName'] = $this->purchaseorder_model->getSupplierName(); - //$data['users'] = $this->purchaseorder_model->getusers(); - - $this->global['pageTitle'] = 'siddharth : AddNew Asset'; - - $this->loadViews("addasset", $this->global, NULL); - } - } - - /** - * This function is used to add new user to the system - */ - function addNewasset() - { - if($this->isAdmin() == TRUE) - { - $this->loadThis(); - } - else - { - $this->load->library('form_validation'); - - //$PO = $this->input->post('SupplierID'); - - //$this->form_validation->set_rules('CostCenterID','Supplier Name','trim'); - $this->form_validation->set_rules('CostName','Address','trim|required|'); - $this->form_validation->set_rules('Description','Contact Number','trim'); - - - - if($this->form_validation->run() == FALSE) - { - $this->addsupplier(); - } - else - { - $CostName = ucwords(strtolower($this->input->post('CostName'))); - $Description = $this->input->post('Description'); - - - - - $Cost = array('CostName'=>$CostName, 'Description'=>$Description,'createdDate'=>date('Y-m-d H:i:sa')); - - $this->load->model('assetdetails_model'); - $result = $this->assetdetails_model->addNewasset($asset); - - if($result > 0) - { - $this->session->set_flashdata('success', 'New PO created successfully'); - } - else - { - $this->session->set_flashdata('error', 'PO Not Create'); - } - - redirect('codeListing'); - } - } - } - /** - * This function is used load user edit information - * @param number $userId : Optional : This is user id - */ - function editOldcost($CostCenterID = NULL) - { - if($this->isAdmin() == TRUE || $CostCenterID == 1) - { - $this->loadThis(); - } - else - { - if($CostCenterID == null) - { - redirect('costListing'); - } - - //$data['SupplierName'] = $this->purchaseorder_model->getSupplierName(); - //$data['users'] = $this->purchaseorder_model->getusers(); - - $this->global['pageTitle'] = 'Siddharth : Edit User'; - - $this->loadViews("editOldcost", $this->global, NULL); - } - } - - /** - * This function is used to edit the user information - */ - function editcost() - { - if($this->isAdmin() == TRUE) - { - $this->loadThis(); - } - else - { - $this->load->library('form_validation'); - - //$PO = $this->input->post('PO'); - - $this->form_validation->set_rules('CostName','Cost Name','trim|required|'); - $this->form_validation->set_rules('Description','Description','trim|required|'); - - - if($this->form_validation->run() == FALSE) - { - $this->editPO(); - } - else - { - $CostName = ucwords(strtolower($this->input->post('CostName'))); - $Description = $this->input->post('Description'); - - $Cost = array('CostName'=>$CostName, 'Description'=>$Description,'createdDtm'=>date('Y-m-d H:i:sa')); - - - - $Cost = array(); - - $result = $this->costcenter_model->editcost($Cost, $CostCentreID); - - if($result == true) - { - $this->session->set_flashdata('success', 'PO updated successfully'); - } - else - { - $this->session->set_flashdata('error', 'PO updation failed'); - } - - redirect('costListing'); - } - } - } - - /** - * This function is used to delete the user using userId - * @return boolean $result : TRUE / FALSE - */ - function deleteUser() - { - if($this->isAdmin() == TRUE) - { - echo(json_encode(array('status'=>'access'))); - } - else - { - $userId = $this->input->post('userId'); - $userInfo = array('isDeleted'=>1,'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:sa')); - - $result = $this->user_model->deleteUser($userId, $userInfo); - - if ($result > 0) { echo(json_encode(array('status'=>TRUE))); } - else { echo(json_encode(array('status'=>FALSE))); } - } - } - - - function pageNotFound() - { - $this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found'; - - $this->loadViews("404", $this->global, NULL, NULL); - } -} - -?> \ No newline at end of file diff --git a/app/CREDITS.md b/app/CREDITS.md deleted file mode 100644 index b6c4dc3f..00000000 --- a/app/CREDITS.md +++ /dev/null @@ -1,49 +0,0 @@ -# Credits - -The following products were used in the creation of Appunto-Auth. Trademarks and copyrights are property of their respective owners. - -## CodeIgniter -http://codeigniter.com/ - -CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to -create full-featured web applications.
- -For licensing information, please visit http://codeigniter.com/user_guide/license.html - -## Sencha Ext JS -http://www.sencha.com/products/extjs/ - -Ext JS is a JavaScript framework for building rich internet applications that work in any web browser. -Appunto-Auth uses the GPL version of Ext JS. - -For licensing information, please visit http://www.sencha.com/products/extjs/licensing/ - -## Silk Icons -http://www.famfamfam.com/lab/icons/silk/ - -Silk is a smooth, free icon set, containing over 700 16-by-16 pixel icons in strokably-soft PNG format. - -Silk is licensed under a Creative Commons Attribution 2.5 License. - -## Fugue Icons -http://p.yusukekamiyamane.com/ - -Icon set by Yusuke Kamiyamane. - -Fugue Icons are licensed under a Creative Commons Attribution 3.0 License. - -## Silk companion icon set -http://www.damieng.com/icons/silkcompanion - -Icon set by Damien Guard. - -Silk companion icon set is licensed under a Creative Commons Attribution 2.5 License. - -## Translations - -__portuguese-br__ - -CodeIgniter translation: https://github.com/CIBr/CodeIgniter-Portuguese-BR - -Appunto-Auth translation: Loanda Drew and Ricardo Silva - diff --git a/app/LICENSE.md b/app/LICENSE.md deleted file mode 100644 index 2a071986..00000000 --- a/app/LICENSE.md +++ /dev/null @@ -1,32 +0,0 @@ -# Appunto-Auth license - -####License for all files except for third party files, the app.js and theme.css files - -Appunto Auth is licensed under a version of the MIT license. -Please do not remove the copyright and permission notice contained in this file. - -Copyright (c) 2012-2014 Bill Clinton (bclinton@appunto.net) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software in the application/libraries/appunto-auth folder - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#### License for all third party files - -The license of all third party files are governed by the terms of their licenses. Please see -the CREDITS.MD file for a list of all third party files. - -#### License for app.js and theme.css files - -Per Sencha requirements, the app.js and theme.css files are governed by the terms of the GPLv3 license. diff --git a/app/README.md b/app/README.md deleted file mode 100644 index f1c6213a..00000000 --- a/app/README.md +++ /dev/null @@ -1,284 +0,0 @@ -# Appunto-Auth - -An authentication library for CodeIgniter with a Sencha Ext JS interface and a simple ACL. - -current release 0.1.3 - -The goal of Appunto-Auth is to provide the CodeIgniter developer with an authentication and user management -system that takes authentication code out of an application's individual controller classes and functions. - -For more information go to http://www.appunto.net/appunto-auth - - - -- [Features](#features) -- [Installing](#installing) - - [CodeIgniter Setup](#codeigniter-setup) - - [Download Appunto-Auth](#download-appunto-auth) - - [Update Codeigniter configuration files](#update-codeigniter-configuration-files) -- [Support for multiple languages](#support-for-multiple-languages) - - [Translating Appunto-Auth](#translating-appunto-auth) -- [Helpers](#helpers) -- [Public Library Functions](#public-library-functions) -- [Additional Notes](#additional-notes) - - [A note on removing index.php](#a-note-on-removing-indexphp) - - [A note on _remap (Remapping Function Calls)](#a-note-on-_remap-remapping-function-calls) - - [Limitations](#limitations) - - - -## Features - - Administrative interface using ExtJS - - Authentication performed in a hook rather than controller code - - Simple ACL with roles and permissions - - Restrict/Allow access using controller/function paths - - Hashes passwords in database using phpass library - - Multiple language support - -## Installing - -### CodeIgniter Setup - -Enable CodeIgniter to use the database to store sessions by following the instructions -in the _Saving Session Data to a Database_ section of the _Session Class_ page in the CodeIgniter -User Guide located at http://codeigniter.com/user_guide/libraries/sessions.html - - - set an __encryption_key__ in CodeIgniter's config/config.php - - create the ci_sessions database table - - enable the database option in your config.php by setting __sess_use_database__ to TRUE in CodeIgniter's config.php - -video walkthrough of this step here: https://www.youtube.com/watch?v=GlQSNBO2Eg4 - - -### Download Appunto-Auth - -The latest version of Appunto-Auth is available at http://www.appunto.net/appunto-auth/download - -You can download the most recent working build at https://github.com/BillClinton/Appunto-Auth - -The Appunto-Auth download contains 4 folders: -``` - . - |-application - |-resources - |-db - |-src -``` - -#### Copy the application and resources folders to your application folder - -The application folder contains controllers, models, views, helpers, libraries, and config folders. -While it is always a good idea to back up your application, the files contained in these folders are in -appunto-auth subfolders and should not overwrite anything in your existing CodeIgniter folder structure. - -The files in the language folder are not in an appunto-auth subfolder, but unless you already have a file -named appunto_auth_lang.php in one of your language folders (unlikely), you don't have to worry about any -language file overwriting - -The files in the resources folder contain javascript, css and images needed by the Appunto-Auth admin interface. - -Copy the downloaded __applications__ and __resources__ folders into your main Codeigniter folder (the folder that -contains the system and application folder) - -Your CodeIgniter folder should now look like this: -``` - . - |-application - |-resources - |-system - |-user_guide (if you haven't deleted it yet) -``` - -### Update Codeigniter configuration files - -#### Load the Appunto_auth.php library file in autoload.php -Include a reference to the Appunto_auth library in CodeIgniter's config/autoload.php file. CodeIgniter will be calling a method in this library in a post_controller_constructor hook, so it will be needed in every controller. Therefore there is no reason to load it in your individual controllers rather than in the autoload file. Example: - -``` -$autoload['libraries'] = array('appunto-auth/appunto_auth'); -``` - -#### Import the Appunto-Auth tables -Use the table creation script in the __db__ folder to create the Appunto-Auth tables. You can use the command line: - -``` -mysql -u [db username] -p [db name] < db/create_auth_db.sql -``` -Or just paste the contents of this file into PhpMyAdmin. - -Your database should already contain the ci_session table. - -#### Include Reference to Hook in hooks.php -Appunto-Auth authenticates the user in a post_controller_constructor hook. The hook function resides in the Appunto_auth.php -library file. A reference to this hook must be included in CodeIgniter's config/hooks.php file using the following format: - -``` -$hook['post_controller_constructor'] = array( - 'class' => 'Appunto_auth', - 'function' => 'require_authentication_hook', - 'filename' => 'appunto-auth/Appunto_auth.php', - 'filepath' => 'libraries', - 'params' => array() -); -``` -#### Enable CodeIgniter hooks -Enable CodeIgniter hooks by setting __enable_hooks__ to TRUE in your application's config.php - -## Support for multiple languages - -The current release of Appunto-Auth includes one additional language: Brazilian Portuguese. If you translate Appunto-Auth -to your native language, I would love to include it in future releases. Please send me the files at code@appunto.net -or fork the project and add them yourself using these instructions: http://kbroman.org/github_tutorial/pages/fork.html - -To try the Portuguese translation, change the value of the $config['language'] setting in the CodeIgniter config/config.php -file from __english__ to __portuguese-br__ - -### Translating Appunto-Auth - -#### Codeigniter language files - -The first step in translating Appunto-Auth is to create or find a translation of the CodeIgniter language files. -When you change the language via the $config['language'] setting in the CodeIgniter config/config.php, CodeIgniter -libraries will expect these files to be there and you will most likely experience PHP errors if they are not there. - -There are many translations out there for CodeIgniter's language files and you should be able to find one for your language. -If not, copy the English files from system/language/english into application/language/your-language to prevent PHP errors. You -can then change the text in these files where necessary. If you complete a full translation, please post it and share it with -other CodeIgniter developers. - -#### Appunto-Auth Codeigniter language file - -Appunto-Auth's CodeIgniter language files are included in the application/language/[language-name] folders. To add your own -translation, create a folder with the name of your language in the application/language/ folder. Copy the -appunto_auth_lang.php into your new folder from one of the other language folders and use it as a template. - - __The name of this folder must match the name of the value of the $config['language'] setting in the CodeIgniter config/config.php__ - - -#### Appunto-Auth admin interface language file - -The language files used to translate many of the elements of the admin interface are javascript files located -at resources/appunto-auth/lang/ . To translate this into your own language, start with the english.js file and rename it to -your-language.js. - - __The name of this file must match the name of the CodeIgniter language folder and the value of the $config['language'] -setting in the CodeIgniter config/config.php__ - -Change the text values from English to your native language, but be very careful about quotes and commas. Javascript can -be very finicky and a missed comma or misplaced quote can cause a javascript error that will prevent the application from -opening at all. If your admin interface does not load, check your syntax. Please convert all accented and special characters -to HTML safe entities using a converter like this: http://www.kidquick.com/JoomlaTools/frenchAccents.htm - -## Helpers - -__appunto_login_box()__ - -creates a login dialog - -__anchor_if_permitted($permission,$uri,$title,$attributes)__ - -Creates an anchor based on the local URL if user has the appropriate permission. The permission parameter is case -sensitive and must match the internal name of a permission you have created in the admin interface for this -function to return a link - -This helper uses the anchor() helper function from CodeIgniter's URL Helper so use the guidelines for that function for -the 2nd, 3rd and 4th parameters. - -__appunto_username()__ - -Returns the user's username, if logged in. - -__appunto_logout_link($show_if_logged_out,$attributes)__ - -Creates a logout link based on the logout path defined in the appunto_auth.php config file, using the logout text specified -in the appunto_auth_lang.php file. - -If the first parameter is true, a logout link will be returned even if the user is not logged in. Defaults to false. - -The second parameter can contain a list of attributes you would like added to the link. The attributes can be a simple -string or an associative array, as defined by the anchor() helper function from CodeIgniter's URL Helper. - -__is_logged_in()__ - -Returns true if the user is logged in, false if the user is not logged in. - -## Public Library Functions - -While one of the goals of Appunto-Auth is to take authentication code out of the application's controllers, -occasionally situations require some user control within the controller classes, for example if you want your -default controller to redirect to another controller depending on the user's permissions. - -These functions can be called using the following syntax: -``` -$this->appunto_auth->function_name() -``` - -__logged_in()__ - -Returns true if the user is logged in, false if the user is not logged in. - -__get_username()__ - -Returns the user's username if the user is logged in, false if the user is not logged in. - -__get_user_id()__ - -Returns the user's id if the user is logged in, false if the user is not logged in. - -__userHasPermission($permission)__ - -The $permission parameter is case sensitive and must match the internal name of a permission you have created in the admin interface. - -Returns true if the user has the specified permission, false if the user is not logged in or does not -have the specified permission. - - -## Additional Notes - -### A note on removing index.php - -You may remove the index.php from your URLs as described in the CodeIgniter user guide, but make sure you alter the rewrite rule to exclude the resources folder so the css and javascript files are not served by the index.php. If you are using the example .htaccess from the user guide: -``` -RewriteEngine on -RewriteCond $1 !^(index\.php|images|robots\.txt) -RewriteRule ^(.*)$ /index.php/$1 [L] -``` -add resources to the RewriteCond line like this: -``` -RewriteEngine on -RewriteCond $1 !^(index\.php|images|robots\.txt|resources) -RewriteRule ^(.*)$ /index.php/$1 [L] -``` -If your application is not being served from the root of your domain, be sure to alter the third line with the correct path: -``` -RewriteRule ^(.*)$ /myapplication/index.php/$1 [L] -``` - -### A note on _remap (Remapping Function Calls) - -CodeIgniter allows the developer to remap function calls as detailed here: https://ellislab.com/codeigniter/user-guide/general/controllers.html#remapping - -If a controller does contain a _remap function, AppuntoAuth's verification procedure will verify the user if the user has -necessary permissions to access a function in that controller that matches the user's request path (the normal procedure), -or if the user has the necessary permissions to access the _remap function. - -As noted in the CodeIgniter user guide: "If your controller contains a function named _remap(), it will always get called -regardless of what your URI contains. It overrides the normal behavior in which the URI determines which function is called, -allowing you to define your own function routing rules." Therefore AppuntoAuth assumes any call to a controller with a _remap -function could be a call to the _remap function and verifies the user's permissions for the _remap function. - -If additional access levels are desired in a controller with a _remap function, the developer must add them to the controller code. - -### Limitations - -#### MySQL only - -The current release has only been tested on MySQL. I hope to add support for other databases in future releases. - -#### Controllers with the same name - -CodeIgniter allows you to have controllers with the same name as long as they are located in different folders. This is not -currently supported by Appunto-Auth and all controller classes in your application must have unique names. - - - diff --git a/app/application/config/appunto-auth/appunto_auth.php b/app/application/config/appunto-auth/appunto_auth.php deleted file mode 100644 index 945e8b01..00000000 --- a/app/application/config/appunto-auth/appunto_auth.php +++ /dev/null @@ -1,87 +0,0 @@ - - -Directory access is forbidden.
- - -