MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
+$page_security = 'SA_OPEN';
$path_to_root="..";
include($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/ui/ui_view.inc");
User authentication page popped up after login timeout during ajax call.
*/
$path_to_root = '..';
-$page_security = 1;
+$page_security = 'SA_OPEN';
include_once($path_to_root . "/includes/session.inc");
include($path_to_root .'/access/login.php');
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$path_to_root="..";
-$page_security = 8;
+$page_security = 'SA_ATTACHDOCUMENT';
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 15;
+$page_security = 'SA_BACKUP';
$path_to_root="..";
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security=1;
+$page_security = 'SA_CHGPASSWD';
$path_to_root="..";
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security =10;
-$path_to_root="..";
+$page_security = 'SA_SETUPCOMPANY';
+$path_to_root = "..";
include($path_to_root . "/includes/session.inc");
page(_("Company Setup"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 20;
+$page_security = 'SA_CREATECOMPANY';
$path_to_root="..";
include_once($path_to_root . "/includes/session.inc");
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-function add_user($user_id, $real_name, $password, $phone, $email, $full_access,
+function add_user($user_id, $real_name, $password, $phone, $email, $role_id,
$language, $profile, $rep_popup, $pos)
{
$sql = "INSERT INTO ".TB_PREF."users (user_id, real_name, password"
- .", phone, email, full_access, language, pos, print_profile, rep_popup)
+ .", phone, email, role_id, language, pos, print_profile, rep_popup)
VALUES (".db_escape($user_id).",
".db_escape($real_name).", ".db_escape($password) .",".db_escape($phone).",
- ".db_escape($email).", $full_access, ".db_escape($language).",
+ ".db_escape($email).", $role_id, ".db_escape($language).",
$pos,".db_escape($profile).",$rep_popup)";
db_query($sql, "could not add user for $user_id");
//-----------------------------------------------------------------------------------------------
-function update_user($id, $user_id, $real_name, $phone, $email, $full_access,
+function update_user($id, $user_id, $real_name, $phone, $email, $role_id,
$language, $profile, $rep_popup, $pos)
{
$sql = "UPDATE ".TB_PREF."users SET real_name=".db_escape($real_name).
", phone=".db_escape($phone).",
email=".db_escape($email).",
- full_access=$full_access,
+ role_id=$role_id,
language=".db_escape($language).",
print_profile=".db_escape($profile).",
rep_popup=$rep_popup,
function get_users($all=false)
{
- $sql = "SELECT * FROM ".TB_PREF."users";
- if (!$all) $sql .= " WHERE !inactive";
-
+ $sql = "SELECT u.*, r.role FROM ".TB_PREF."users u, ".TB_PREF."security_roles r
+ WHERE u.role_id=r.id";
+ if (!$all) $sql .= " AND !u.inactive";
+
return db_query($sql, "could not get users");
}
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
+$page_security = 'SA_SETUPDISPLAY';
$path_to_root="..";
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 9;
-$path_to_root="..";
+$page_security = 'SA_FISCALYEARS';
+$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security =10;
-$path_to_root="..";
+$page_security = 'SA_FORMSETUP';
+$path_to_root = "..";
include($path_to_root . "/includes/session.inc");
page(_("Forms Setup"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security =10;
+$page_security = 'SA_GLSETUP';
$path_to_root="..";
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 20;
+$page_security = 'SA_CREATELANGUAGE';
$path_to_root="..";
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 20;
+$page_security = 'SA_CREATEMODULES';
$path_to_root="..";
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 20;
+$page_security = 'SA_SOFTWAREUPGRADE';
$path_to_root="..";
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 10;
+$page_security = 'SA_PAYTERMS';
$path_to_root="..";
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 15;
-$path_to_root="..";
+$page_security = 'SA_PRINTPROFILE';
+$path_to_root = "..";
include($path_to_root . "/includes/session.inc");
include($path_to_root . "/admin/db/printers_db.inc");
include($path_to_root . "/includes/ui.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 15;
+$page_security = 'SA_PRINTERS';
$path_to_root="..";
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 14;
+$page_security = 'SA_SHIPPING';
$path_to_root="..";
include($path_to_root . "/includes/session.inc");
page(_("Shipping Company"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security=15;
-$path_to_root="..";
+$page_security = 'SA_USERS';
+$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
page(_("Users"));
label_cell($myrow["phone"]);
email_cell($myrow["email"]);
label_cell($last_visit_date, "nowrap");
- label_cell($security_headings[$myrow["full_access"]]);
+ label_cell($myrow["role"]);
if ($not_me)
inactive_control_cell($myrow["id"], $myrow["inactive"], 'users', 'id');
$_POST['real_name'] = $myrow["real_name"];
$_POST['phone'] = $myrow["phone"];
$_POST['email'] = $myrow["email"];
- $_POST['Access'] = $myrow["full_access"];
+ $_POST['Access'] = $myrow["role_id"];
$_POST['language'] = $myrow["language"];
$_POST['profile'] = $myrow["print_profile"];
$_POST['rep_popup'] = $myrow["rep_popup"];
email_row_ex(_("Email Address:"), 'email', 50);
-security_headings_list_row(_("Access Level:"), 'Access', null);
+security_roles_list_row(_("Access Level:"), 'Access', null);
languages_list_row(_("Language:"), 'language', null);
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$path_to_root="..";
-$page_security = 5;
+$page_security = 'SA_VIEWPRINTTRANSACTION';
+$path_to_root = "..";
include($path_to_root . "/includes/db_pager.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$path_to_root="..";
-$page_security = 14;
+$page_security = 'SA_VOIDTRANSACTION';
+$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
var $link;
var $access;
- function app_function($label,$link,$access=1)
+ function app_function($label,$link,$access='SA_OPEN')
{
$this->label = $label;
$this->link = $link;
$this->rappfunctions = array();
}
- function add_lapp_function($label,$link="",$access=1)
+ function add_lapp_function($label,$link="",$access='SA_OPEN')
{
$appfunction = new app_function($label,$link,$access);
//array_push($this->lappfunctions,$appfunction);
return $appfunction;
}
- function add_rapp_function($label,$link="",$access=1)
+ function add_rapp_function($label,$link="",$access='SA_OPEN')
{
$appfunction = new app_function($label,$link,$access);
//array_push($this->rappfunctions,$appfunction);
return $module;
}
- function add_lapp_function($level, $label,$link="",$access=1)
+ function add_lapp_function($level, $label,$link="",$access='SA_OPEN')
{
$this->modules[$level]->lappfunctions[] = new app_function($label, $link, $access);
}
- function add_rapp_function($level, $label,$link="",$access=1)
+ function add_rapp_function($level, $label,$link="",$access='SA_OPEN')
{
$this->modules[$level]->rappfunctions[] = new app_function($label, $link, $access);
}
$this->add_module(_("Company Setup"));
$this->add_lapp_function(0, _("&Company Setup"),"admin/company_preferences.php?");
- $this->add_lapp_function(0, _("&User Accounts Setup"),"admin/users.php?", 15);
- $this->add_lapp_function(0, _("&Access Setup"),"admin/security_roles.php?", 20);
+ $this->add_lapp_function(0, _("&User Accounts Setup"),"admin/users.php?", 'SA_USERS');
+ $this->add_lapp_function(0, _("&Access Setup"),"admin/security_roles.php?", 'SA_SECROLES');
$this->add_lapp_function(0, _("&Display Setup"),"admin/display_prefs.php?");
$this->add_lapp_function(0, _("&Forms Setup"),"admin/forms_setup.php?");
$this->add_rapp_function(0, _("&Taxes"),"taxes/tax_types.php?");
$this->add_lapp_function(2, _("&Void a Transaction"),"admin/void_transaction.php?");
$this->add_lapp_function(2, _("View or &Print Transactions"),"admin/view_print_transaction.php?");
$this->add_lapp_function(2, _("&Attach Documents"),"admin/attachments.php?filterType=20");
- $this->add_rapp_function(2, _("&Backup and Restore"),"admin/backups.php?", 15);
- $this->add_rapp_function(2, _("Create/Update &Companies"),"admin/create_coy.php?", 14);
- $this->add_rapp_function(2, _("Install/Update &Languages"),"admin/inst_lang.php?", 14);
- $this->add_rapp_function(2, _("Install/Update &Modules"),"admin/inst_module.php?", 15);
- $this->add_rapp_function(2, _("Software &Upgrade"),"admin/inst_upgrade.php?", 15);
+ $this->add_rapp_function(2, _("&Backup and Restore"),"admin/backups.php?", 'SA_BACKUP');
+ $this->add_rapp_function(2, _("Create/Update &Companies"),"admin/create_coy.php?", 'SA_CREATECOMPANY');
+ $this->add_rapp_function(2, _("Install/Update &Languages"),"admin/inst_lang.php?", 'SA_CREATELANGUAGE');
+ $this->add_rapp_function(2, _("Install/Update &Modules"),"admin/inst_module.php?", 'SA_CREATEMODULES');
+ $this->add_rapp_function(2, _("Software &Upgrade"),"admin/inst_upgrade.php?", 'SA_SOFTWAREUPGRADE');
if (count($installed_modules) > 0)
{
foreach ($installed_modules as $mod)
/* skin for Business Graphics, 1, 2 or 3 */
$graph_skin = 1;
- /*Security Group definitions - Depending on the AccessLevel of the user defined in the user set up
- the areas of functionality accessible can be modified.
- Each AccessLevel is associated with an array containing the security categories that the user is entitled to access
- Each script has a particular security category associated with it.
- If the security setting of the page is contained in the security group as determined by the access level then the user will be allowed access.
- Each page has a $page_security = x; variable
- This value is compared to contents of the array applicable which is based on the access level of the user.
- Access authorisation is checked in session.inc. If you wish to add more security groups
- with then you must add a new SecurityHeading to the security_headings array
- and a new array of Security categories to the Security Groups _at_the_end_ of the array
- This mechanism allows more fine grained control of access
- security_groups is an array of arrays
- The index is the order in which the array of allowed pages is defined new ones can be defined at will
- or by changing the numbers in each array the security access can be tailored. These numbers need to read
- in conjunction with the Page Security index
- Special case is security level 20 which is reserved for admins of first
- registered company (site admins). All potentially dangerous for whole FA
- site operations like installing addon modules require access level 20.
- */
+/*
+ Before upgrade from pre-2.2 FA you have to move here your customized
+ security roles definitions. If you have used standard roles, you
+ can simply uncomment following two arrays. After upgrade both arrays need
+ to be deleted or commented out. You may wish to change user roles to
+ new better defined in Users Setup. Old not used roles can be set inactive
+ or deleted.
+*/
+/* Standard FA2.1 Security Group definitions
$security_headings = array(
_("Inquiries"),
array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,16),
array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,20),
);
+*/
//MySQL Backup and Restore Settings
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 10;
-$path_to_root="..";
+$page_security = 'SA_DIMENSION';
+$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_DIMTRANSVIEW';
$path_to_root="../..";
include($path_to_root . "/includes/db_pager.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 10;
-$path_to_root="../..";
+$page_security = 'SA_DIMTRANSVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
/* Author Rob Mallon */
-$page_security = 8;
-$path_to_root="..";
+$page_security = 'SA_RECONCILE';
+$path_to_root = "..";
include($path_to_root . "/includes/db_pager.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$path_to_root="..";
-$page_security = 5;
+$page_security = 'SA_BANKTRANSFER';
+$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="..";
+$page_security = isset($_GET['NewPayment']) ? 'SA_PAYMENT' : 'SA_DEPOSIT';
+$path_to_root = "..";
include_once($path_to_root . "/includes/ui/items_cart.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 10;
-$path_to_root="..";
+$page_security = 'SA_BUDGETENTRY';
+$path_to_root = "..";
include($path_to_root . "/includes/session.inc");
add_js_file('budget.js');
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="..";
+$page_security = 'SA_JOURNALENTRY';
+$path_to_root = "..";
include_once($path_to_root . "/includes/ui/items_cart.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 8;
+$page_security = 'SA_BANKTRANSVIEW';
$path_to_root="../..";
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 8;
-$path_to_root="../..";
+$page_security = 'SA_GLTRANSVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 8;
+$page_security = 'SA_GLANALYTIC';
$path_to_root="../..";
include_once($path_to_root . "/includes/session.inc");
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 8;
+$page_security = 'SA_GLANALYTIC';
$path_to_root="../..";
include($path_to_root . "/includes/db_pager.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 8;
+$page_security = 'SA_TAXREP';
$path_to_root="../..";
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 10;
-$path_to_root="../..";
+$page_security = 'SA_BANKACCOUNT';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Bank Accounts"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 9;
-$path_to_root="../..";
+$page_security = 'SA_CURRENCY';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
page(_("Currencies"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 9;
-$path_to_root="../..";
+$page_security = 'SA_EXCHANGERATE';
+$path_to_root = "../..";
include($path_to_root . "/includes/db_pager.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="../..";
+$page_security = 'SA_GLACCOUNTCLASS';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("GL Account Classes"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="../..";
+$page_security = 'SA_GLACCOUNTGROUP';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("GL Account Groups"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 10;
-$path_to_root="../..";
+$page_security = 'SA_GLACCOUNT';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Chart of Accounts"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="../..";
+$page_security = 'SA_QUICKENTRY';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Quick Entries"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
+$page_security = 'SA_BANKTRANSVIEW';
$path_to_root="../..";
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
-$path_to_root="../..";
+$page_security = 'SA_BANKTRANSVIEW';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
-$path_to_root="../..";
+$page_security = 'SA_BANKTRANSVIEW';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 8;
-$path_to_root="../..";
+$page_security = 'SA_GLTRANSVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
page(_("General Ledger Transaction Details"), true);
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
/*
- Security sections groups various areas on both functionality and privilige levels.
- Often analyti inquires are available only for management, and configuration
+ Security sections groups various areas on both functionality and privilege levels.
+ Often analytic inquires are available only for management, and configuration
for administration or management staff. This is why we have those three
- sections related to near every FA module.
-
- Every security section can contain up to 256 different areas.
+ section type inside near every FA module.
+
Section codes 0-99 are reserved for core FA functionalities.
- External modules can extend security roles system by adding rows to security sections and
- security areas using section code >=100.
+ Every security section can contain up to 256 different areas.
+ External modules can extend security roles system by adding rows to
+ $security_sections and $security_areas using section codes >=100.
*/
define('SS_SADMIN', 1<<8); // site admin
define('SS_SETUP', 2<<8); // company level setup
SS_SPEC => _("Special maintenance"),
SS_SALES_C => _("Sales configuration"),
SS_SALES => _("Sales transactions"),
- SS_SALES_A => _("Sales analytics"),
+ SS_SALES_A => _("Sales related reports"),
SS_PURCH_C => _("Purchase configuration"),
SS_PURCH => _("Purchase transactions"),
SS_PURCH_A => _("Purchase analytics"),
/*
This table stores security areas available in FA.
Key is area identifier used to check user rights, values are
- code stored for each role in security_roles table and description used
+ codes stored for each role in security_roles table and description used
in roles editor.
Set of allowed access areas codes is retrieved during user login from
- security_roles table, and stored in user profile for direct during the session.
+ security_roles table, and cached in user profile.
+ Special value 'SA_OPEN' is used for publicly available pages like login/logout.
*/
$security_areas =array(
//
//
// Company setup
//
- 'SA_CRSTATUS' => array(SS_SETUP|1, _("Credit status definitions changes")),
- 'SA_INVENTORYLOCATION' => array(SS_SETUP|2, _("Inventory locations changes")),
- 'SA_INVENTORYMOVETYPE' => array(SS_SETUP|3, _("Inventory movement types")),
- 'SA_WORKCENTRE' => array(SS_SETUP|4, _("Manufacture work centres ")),
- 'SA_SETUPCOMPANY' => array(SS_SETUP|5, _("Company parameters")),
- 'SA_SETUPUSER' => array(SS_SETUP|6, _("Users setup")),
- 'SA_SETUPFORM' => array(SS_SETUP|7, _("Forms setup")),
- 'SA_PRINTPROFILE' => array(SS_SETUP|8, _("Print profiles")),
- 'SA_PAYMENTTERM' => array(SS_SETUP|9, _("Payment terms")),
- 'SA_SHIPPING' => array(SS_SETUP|10, _("Shipping ways")),
- 'SA_SETUPPOS' => array(SS_SETUP|11, _("Point of sales definitions")),
- 'SA_SETUPPRINTER' => array(SS_SETUP|12, _("Printers configuration")),
-
-// special and common functions
- 'SA_VIEWPRINTTRANSACTION' => array(SS_SPEC|1, _("Common view/print transactions interface")),
- 'SA_ATTACHDOCUMENT' => array(SS_SPEC|2, _("Attaching documents")),
- 'SA_VOIDTRANSACTION' => array(SS_SPEC|3, _("Voiding transactions")),
- 'SA_BACKUP' => array(SS_SPEC|4, _("Database backup/restore")),
+ 'SA_SETUPCOMPANY' => array(SS_SETUP|1, _("Company parameters")),
+ 'SA_SECROLES' => array(SS_SETUP|2, _("Access levels edition")),
+ 'SA_USERS' => array(SS_SETUP|3, _("Users setup")),
+ 'SA_POSSETUP' => array(SS_SETUP|4, _("Point of sales definitions")),
+ 'SA_PRINTERS' => array(SS_SETUP|5, _("Printers configuration")),
+ 'SA_PRINTPROFILE' => array(SS_SETUP|6, _("Print profiles")),
+ 'SA_PAYTERMS' => array(SS_SETUP|7, _("Payment terms")),
+ 'SA_SHIPPING' => array(SS_SETUP|8, _("Shipping ways")),
+ 'SA_CRSTATUS' => array(SS_SETUP|9, _("Credit status definitions changes")),
+ 'SA_INVENTORYLOCATION' => array(SS_SETUP|10, _("Inventory locations changes")),
+ 'SA_INVENTORYMOVETYPE' => array(SS_SETUP|11, _("Inventory movement types")),
+ 'SA_WORKCENTRES' => array(SS_SETUP|12, _("Manufacture work centres")),
+ 'SA_FORMSETUP' => array(SS_SETUP|13, _("Forms setup")),
+//
+// Special and common functions
+//
+ 'SA_VOIDTRANSACTION' => array(SS_SPEC|1, _("Voiding transactions")),
+ 'SA_BACKUP' => array(SS_SPEC|2, _("Database backup/restore")),
+ 'SA_VIEWPRINTTRANSACTION' => array(SS_SPEC|3, _("Common view/print transactions interface")),
+ 'SA_ATTACHDOCUMENT' => array(SS_SPEC|4, _("Attaching documents")),
+ 'SA_SETUPDISPLAY' => array(SS_SPEC|5, _("Display preferences")), //???
+ 'SA_CHGPASSWD' => array(SS_SPEC|6, _("Password changes")), //???
+//
// Sales related functionality
//
- 'SA_STEMPLATE' => array(SS_SALES_C|1, _("Sales templates")),
- 'SA_SRECURRENT' => array(SS_SALES_C|2, _("Recurrent invoices definitions")),
- 'SA_SALESPRICE' => array(SS_SALES_C|3, _("Sales prices edition")),
- 'SA_SALESGROUP' => array(SS_SALES_C|4, _("Sales groups changes")),
- 'SA_SALESMAN' => array(SS_SALES_C|5, _("Sales staff maintenance")),
- 'SA_SALESAREA' => array(SS_SALES_C|6, _("Sales areas maintenance")),
-
- 'SA_CUSTOMER' => array(SS_SALES|1, _("Sales customer and branches changes")),
- 'SA_SALESORDER' => array(SS_SALES|2, _("Sales orders edition")),
- 'SA_SALESDELIVERY' => array(SS_SALES|3, _("Sales deliveries edition")),
- 'SA_SALESINVOICE' => array(SS_SALES|4, _("Sales invoices edition")),
- 'SA_SALESCREDITINV' => array(SS_SALES|5, _("Sales credit notes against invoice")),
- 'SA_SALESCREDIT' => array(SS_SALES|6, _("Sales freehand credit notes")),
- 'SA_SALESPAYMNT' => array(SS_SALES|7, _("Customer payments entry")),
- 'SA_SALESALLOC' => array(SS_SALES|1, _("Customer payments allocation")),
-
- 'SA_SALESANALYTIC' => array(SS_SALES_A|2, _("Customer analytical reports and inquiries")),
- 'SA_SALESMANREP' => array(SS_SALES_A|3, _("Sales reports")),
- 'SA_SALESVARREP' => array(SS_SALES_A|4, _("Sales other reports and inquires")),
+ 'SA_SALESTYPES' => array(SS_SALES_C|1, _("Sales types")),
+ 'SA_SALESPRICE' => array(SS_SALES_C|2, _("Sales prices edition")),
+ 'SA_SALESMAN' => array(SS_SALES_C|3, _("Sales staff maintenance")),
+ 'SA_SALESAREA' => array(SS_SALES_C|4, _("Sales areas maintenance")),
+ 'SA_SALESGROUP' => array(SS_SALES_C|5, _("Sales groups changes")),
+ 'SA_STEMPLATE' => array(SS_SALES_C|6, _("Sales templates")),
+ 'SA_SRECURRENT' => array(SS_SALES_C|7, _("Recurrent invoices definitions")),
+
+ 'SA_SALESTRANSVIEW' => array(SS_SALES|1, _("Sales transactions view")),
+ 'SA_CUSTOMER' => array(SS_SALES|2, _("Sales customer and branches changes")),
+ 'SA_SALESORDER' => array(SS_SALES|3, _("Sales orders edition")),
+ 'SA_SALESDELIVERY' => array(SS_SALES|4, _("Sales deliveries edition")),
+ 'SA_SALESINVOICE' => array(SS_SALES|5, _("Sales invoices edition")),
+ 'SA_SALESCREDITINV' => array(SS_SALES|6, _("Sales credit notes against invoice")),
+ 'SA_SALESCREDIT' => array(SS_SALES|7, _("Sales freehand credit notes")),
+ 'SA_SALESPAYMNT' => array(SS_SALES|8, _("Customer payments entry")),
+ 'SA_SALESALLOC' => array(SS_SALES|9, _("Customer payments allocation")),
+
+ 'SA_SALESANALYTIC' => array(SS_SALES_A|1, _("Sales analytical reports")),
+ 'SA_SALESBULKREP' => array(SS_SALES_A|2, _("Sales document bulk reports")),
+ 'SA_PRICEREP' => array(SS_SALES_A|3, _("Sales prices listing")),
+ 'SA_SALESMANREP' => array(SS_SALES_A|4, _("Sales staff listing")),
+ 'SA_CUSTBULKREP' => array(SS_SALES_A|5, _("Customer bulk listing")),
+ 'SA_CUSTSTATREP' => array(SS_SALES_A|6, _("Customer status report")),
+ 'SA_CUSTPAYMREP' => array(SS_SALES_A|7, _("Customer payments report")),
//
// Purchase related functions
//
'SA_PURCHASEPRICING' => array(SS_PURCH_C|1, _("Purchase price changes")),
- 'SA_SUPPLIER' => array(SS_PURCH|1, _("Suppliers data changes")),
- 'SA_PURCHASEORDER' => array(SS_PURCH|2, _("Purchase order entry")),
- 'SA_GRN' => array(SS_PURCH|3, _("Purchase receive")),
- 'SA_SUPPLIERINVOICE' => array(SS_PURCH|4, _("Supplier invoices")),
- 'SA_SUPPLIERCREDIT' => array(SS_PURCH|5, _("Supplier credit notes")),
- 'SA_SUPPLIERPAYMNT' => array(SS_PURCH|6, _("Supplier payments")),
- 'SA_SUPPLIERALLOC' => array(SS_PURCH|7, _("Supplier payments allocations")),
-
- 'SA_SUPPLIERANALYTIC' => array(SS_PURCH_A|1, _("Supplier analytical reports and inquiries")),
- 'SA_SUPPLIERMANREP' => array(SS_PURCH_A|2, _("Supplier reports")),
- 'SA_SUPPLIERVARREP' => array(SS_PURCH_A|3, _("Supplier other reports and inquiries")),
+ 'SA_SUPPTRANSVIEW' => array(SS_PURCH|1, _("Supplier transactions view")),
+ 'SA_SUPPLIER' => array(SS_PURCH|2, _("Suppliers changes")),
+ 'SA_PURCHASEORDER' => array(SS_PURCH|3, _("Purchase order entry")),
+ 'SA_GRN' => array(SS_PURCH|4, _("Purchase receive")),
+ 'SA_SUPPLIERINVOICE' => array(SS_PURCH|5, _("Supplier invoices")),
+ 'SA_SUPPLIERCREDIT' => array(SS_PURCH|6, _("Supplier credit notes")),
+ 'SA_SUPPLIERPAYMNT' => array(SS_PURCH|7, _("Supplier payments")),
+ 'SA_SUPPLIERALLOC' => array(SS_PURCH|8, _("Supplier payments allocations")),
+
+ 'SA_SUPPLIERANALYTIC' => array(SS_PURCH_A|1, _("Supplier analytical reports")),
+ 'SA_SUPPBULKREP' => array(SS_SALES_A|2, _("Supplier document bulk reports")),
+ 'SA_SUPPPAYMREP' => array(SS_PURCH_A|3, _("Supplier payments report")),
//
// Inventory
//
'SA_ITEMCATEGORY' => array(SS_ITEMS_C|3, _("Item categories")),
'SA_UOM' => array(SS_ITEMS_C|4, _("Units of measure")),
- 'SA_FORITEMCODE' => array(SS_ITEMS|1, _("Foreign item codes entry")),
- 'SA_LOCATIONTRANSFER' => array(SS_ITEMS|2, _("Inventory location transfers")),
- 'SA_INVENTORYADJUSTMENT' => array(SS_ITEMS|3, _("Inventory adjustments")),
+ 'SA_ITEMSSTATVIEW' => array(SS_ITEMS|1, _("Stock status view")),
+ 'SA_ITEMSTRANSVIEW' => array(SS_ITEMS|2, _("Stock transactions view")),
+ 'SA_FORITEMCODE' => array(SS_ITEMS|3, _("Foreign item codes entry")),
+ 'SA_LOCATIONTRANSFER' => array(SS_ITEMS|4, _("Inventory location transfers")),
+ 'SA_INVENTORYADJUSTMENT' => array(SS_ITEMS|5, _("Inventory adjustments")),
'SA_REORDER' => array(SS_ITEMS_A|1, _("Reorder levels")),
'SA_ITEMSANALYTIC' => array(SS_ITEMS_A|2, _("Items analytical reports and inquiries")),
- 'SA_ITEMSMANREP' => array(SS_ITEMS_A|3, _("Inventory reports")),
- 'SA_ITEMSVARREP' => array(SS_ITEMS_A|4, _("Inventory other reports and inquiries")),
+ 'SA_ITEMSVALREP' => array(SS_ITEMS_A|3, _("Inventory valuation report")),
//
// Manufacturing module
//
'SA_BOM' => array(SS_MANUF_C|1, _("Bill of Materials")),
- 'SA_WORKORDERENTRY' => array(SS_MANUF|1, _("Work order entry")),
- 'SA_WORKORDEROPERATION' => array(SS_MANUF|2, _("Work order operations")),
+ 'SA_MANUFTRANSVIEW' => array(SS_MANUF|1, _("Manufacturing operations view")),
+ 'SA_WORKORDERENTRY' => array(SS_MANUF|2, _("Work order entry")),
+ 'SA_MANUFISSUE' => array(SS_MANUF|3, _("Material issues entry")),
+ 'SA_MANUFRECEIVE' => array(SS_MANUF|4, _("Final product receive")),
+ 'SA_MANUFRELEASE' => array(SS_MANUF|5, _("Work order releases")),
'SA_WORKORDERANALYTIC' => array(SS_MANUF_A|1, _("Work order analytical reports and inquiries")),
- 'SA_WORKORDERMANREP' => array(SS_MANUF_A|2, _("Work order reports")),
- 'SA_WORKORDERVARREP' => array(SS_MANUF_A|3, _("Work order other reports and inquiries")),
-
+ 'SA_WORKORDERCOST' => array(SS_MANUF_A|2, _("Manufacturing cost inquiry")),
+ 'SA_MANUFBULKREP' => array(SS_SALES_A|3, _("Work order bulk reports")),
+ 'SA_BOMREP' => array(SS_MANUF_A|4, _("Bill of materials reports")),
//
// Dimensions
//
- 'SA_DIMENSION' => array(SS_DIM|1, _("Dimensions")),
+ 'SA_DIMTRANSVIEW' => array(SS_DIM|1, _("Dimension view")),
- 'SA_DIMENSIONOPERATION' => array(SS_DIM|2, _("Dimension operations")),
+ 'SA_DIMENSION' => array(SS_DIM|2, _("Dimension entry")),
- 'SA_DIMENSIONANALYTIC' => array(SS_DIM|3, _("Dimension analytical reports and inquiries")),
- 'SA_DIMENSIONMANREP' => array(SS_DIM|4, _("Dimension reports")),
- 'SA_DIMENSIONVARREP' => array(SS_DIM|5, _("Dimension other reports and inquiries")),
+ 'SA_DIMENSIONREP' => array(SS_DIM|3, _("Dimension reports")),
//
// Banking and General Ledger
//
'SA_QUICKENTRY' => array(SS_GL_C|5, _("Quick GL entry definitions")),
'SA_CURRENCY' => array(SS_GL_C|6, _("Currencies")),
'SA_BANKACCOUNT' => array(SS_GL_C|7, _("Bank accounts")),
- 'SA_SETUPTAX' => array(SS_GL_C|8, _("Tax rates")),
- 'SA_SETUPFISCALYEAR' => array(SS_GL_C|9, _("Fiscal years maintenance")),
-
- 'SA_EXCHANGERATE' => array(SS_GL|1, _("Exchange rate table changes")),
- 'SA_PAYMENT' => array(SS_GL|2, _("Bank payments")),
- 'SA_DEPOSIT' => array(SS_GL|3, _("Bank deposits")),
- 'SA_BANKACCOUNTTRANSFER' => array(SS_GL|4, _("Bank account transfers")),
- 'SA_JOURNALENTRY' => array(SS_GL|5, _("Manual journal entries")),
- 'SA_BUDGETENTRY' => array(SS_GL|6, _("Budget edition")),
+ 'SA_TAXRATES' => array(SS_GL_C|8, _("Tax rates")),
+ 'SA_TAXGROUPS' => array(SS_GL_C|8, _("Tax groups")),
+ 'SA_FISCALYEARS' => array(SS_GL_C|9, _("Fiscal years maintenance")),
+ 'SA_GLSETUP' => array(SS_GL_C|10, _("Company GL setup")),
+
+ 'SA_BANKTRANSVIEW' => array(SS_GL|1, _("Bank transactions view")),
+ 'SA_GLTRANSVIEW' => array(SS_GL|2, _("GL postings view")),
+ 'SA_EXCHANGERATE' => array(SS_GL|3, _("Exchange rate table changes")),
+ 'SA_PAYMENT' => array(SS_GL|4, _("Bank payments")),
+ 'SA_DEPOSIT' => array(SS_GL|5, _("Bank deposits")),
+ 'SA_BANKTRANSFER' => array(SS_GL|6, _("Bank account transfers")),
'SA_RECONCILE' => array(SS_GL|7, _("Bank reconciliation")),
- 'SA_STANDARDCOST' => array(SS_GL|8, _("Item standard costs")),
-
- 'SA_GLANALYTIC' => array(SS_GL_A|1, _("Bank and GL analytical reports and inquiries")),
- 'SA_GLMANREP' => array(SS_GL_A|2, _("Bank and GL reports")),
- 'SA_GLVARREP' => array(SS_GL_A|3, _("Bank and GL other reports and inquiries"))
+ 'SA_JOURNALENTRY' => array(SS_GL|8, _("Manual journal entries")),
+ 'SA_BUDGETENTRY' => array(SS_GL|9, _("Budget edition")),
+ 'SA_STANDARDCOST' => array(SS_GL|10, _("Item standard costs")),
+
+ 'SA_GLANALYTIC' => array(SS_GL_A|1, _("GL analytical reports and inquiries")),
+ 'SA_TAXREP' => array(SS_GL_A|2, _("Tax reports and inquiries")),
+ 'SA_BANKREP' => array(SS_GL_A|3, _("Bank reports and inquiries")),
+ 'SA_GLREP' => array(SS_GL_A|4, _("GL reports and inquiries")),
);
?>
\ No newline at end of file
var $access;
var $timeout;
var $last_act;
-
+ var $role_set = false;
+
var $logged;
var $ui_mode = 0;
function login($company, $loginname, $password)
{
+ global $security_areas, $security_groups, $security_headings;
+
$this->set_company($company);
$this->logged = false;
{
$myrow = db_fetch($Auth_Result);
if (! @$myrow["inactive"]) {
- $this->access = $myrow["full_access"];
+ if (isset($myrow["full_access"])) {
+ // Transition code:
+ // db was not yet upgraded after source update to v.2.2
+ // give enough access for admin user to continue upgrade
+ if (!isset($security_groups) || !isset($security_headings)) {
+ echo "<center><br><br><font size='5' color='red'><b>";
+ echo _('Before software upgrade you have to include old $security_groups and $security_headings arrays from old config.php file to the new one.');
+ echo "</b></font><br><br></center>";
+ exit;
+ }
+ $this->access = $myrow["full_access"];
+ if (in_array(20, $security_groups[$this->access]))
+ // temporary access for admin users
+ $this->role_set[] = $security_areas['SA_SOFTWAREUPGRADE'][0];
+ else {
+ echo "<center><br><br><font size='5' color='red'><b>";
+ echo _('System is available for site admin only until full database upgrade');
+ echo "</b></font><br><br></center>";
+ exit;
+ }
+ } else {
+ $this->role_set = array();
+ $this->access = $myrow["role_id"];
+ // store area codes available for current user role
+ $role = get_security_role($this->access);
+ if (!$role)
+ return false;
+ foreach( $role['areas'] as $code )
+ // filter only area codes for enabled security sections
+ if (in_array($code&~0xff, $role['sections']))
+ $this->role_set[] = $code;
+ }
$this->name = $myrow["real_name"];
$this->pos = $myrow["pos"];
$this->loginname = $loginname;
$this->timeout = session_timeout();
}
}
-
return $this->logged;
}
function check_user_access()
{
global $security_groups;
- return is_array($security_groups[$this->access]);
+ if (isset($security_groups)) {
+ // notification after upgrade from pre-2.2 version
+// display_notification(_("After database upgrade don't forget to remove \$security_groups and \$security_headings from config.php file!"));
+ return is_array(@$security_groups[$this->access]);
+ } else
+ return is_array($this->role_set);
}
function can_access_page($page_level)
{
- global $security_groups;
- // first registered company has site admin privileges
- return isset($page_level) && in_array($page_level, $security_groups[$this->access])
- && ($this->company == 0 || $page_level != 20);
+ global $security_groups, $security_areas;
+
+ if (isset($security_groups)) {
+ return $this->company == 0 &&
+ in_array(20, $security_groups[$this->access]);
+ }
+
+ if ($page_level === 'SA_OPEN')
+ return true;
+ $code = $security_areas[$page_level][0];
+ // only first registered company has site admin privileges
+ return $code && in_array($code, $this->role_set)
+ && ($this->company == 0 || ($code&~0xff != SS_SADMIN));
}
function get_db_connection()
{
if (!$_SESSION["wa_current_user"]->check_user_access())
{
- echo "<br><br><br><center>";
- echo "<b>" . _("Security settings have not been defined for your user account.");
- echo "<br>" . _("Please contact your system administrator.") . "</b>";
-
+ // notification after upgrade from pre-2.2 version
+ $msg = is_array($_SESSION["wa_current_user"]->role_set) ?
+ _("Please remove \$security_groups and \$security_headings arrays from config.php file!")
+ : _("Security settings have not been defined for your user account.")
+ . "<br>" . _("Please contact your system administrator.");
+
+ page(_("Access denied"), false);
+ display_error($msg);
+ end_page();
kill_login();
exit;
}
die("Restricted access");
include_once($path_to_root . "/frontaccounting.php");
+include_once($path_to_root . "/admin/db/security_db.inc");
include_once($path_to_root . "/includes/current_user.inc");
include_once($path_to_root . "/includes/lang/language.php");
include_once($path_to_root . "/config_db.php");
$Hooks = new Hooks();
}
+include_once($path_to_root . "/includes/access_levels.inc");
include_once($path_to_root . "/config.php");
include_once($path_to_root . "/includes/main.inc");
$_SESSION["App"]->init();
}
-// Run with debugging messages for the system administrator(s) but not anyone else
-/*if (in_array(15, $security_groups[$_SESSION["AccessLevel"]])) {
- $debug = 1;
-} else {
- $debug = 0;
-}*/
-
//----------------------------------------------------------------------------------------
check_page_security($page_security);
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$path_to_root=".";
- $page_security = 1;
+ $page_security = 'SA_OPEN';
ini_set('xdebug.auto_trace',1);
include_once("includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="..";
+$page_security = 'SA_INVENTORYADJUSTMENT';
+$path_to_root = "..";
include_once($path_to_root . "/includes/ui/items_cart.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
-$path_to_root="..";
+$page_security = 'SA_STANDARDCOST';
+$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
-$path_to_root="../..";
+$page_security = 'SA_ITEMSTRANSVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
-$path_to_root="../..";
+$page_security = 'SA_ITEMSSTATVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
if (isset($_GET['stock_id'])){
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 11;
-$path_to_root="../..";
+$page_security = 'SA_ITEMCATEGORY';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Item Categories"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 11;
-$path_to_root="../..";
+$page_security = 'SA_FORITEMCODE';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
page(_("Foreign Item Codes"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 11;
-$path_to_root="../..";
+$page_security = 'SA_UOM';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Units of Measure"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 11;
-$path_to_root="../..";
+$page_security = 'SA_ITEM';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Items"), @$_REQUEST['popup']);
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 11;
-$path_to_root="../..";
+$page_security = 'SA_INVENTORYLOCATION';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Inventory Locations"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="../..";
+$page_security = 'SA_INVENTORYMOVETYPE';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Inventory Movement Types"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 11;
-$path_to_root="../..";
+$page_security = 'SA_SALESKIT';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
page(_("Sales Kits & Alias Codes"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
-$path_to_root="..";
+$page_security = 'SA_SALESPRICE';
+$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
page(_("Inventory Item Sales prices"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 4;
-$path_to_root="..";
+$page_security = 'SA_PURCHASEPRICING';
+$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
page(_("Supplier Purchasing Data"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 4;
-$path_to_root="..";
+$page_security = 'SA_REORDER';
+$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
page(_("Reorder Levels"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="..";
+$page_security = 'SA_LOCATIONTRANSFER';
+$path_to_root = "..";
include_once($path_to_root . "/includes/ui/items_cart.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
-$path_to_root="../..";
+$page_security = 'SA_ITEMSTRANSVIEW';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
-$path_to_root="../..";
+$page_security = 'SA_ITEMSTRANSVIEW';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
-$path_to_root="../..";
+$page_security = 'SA_WORKORDERCOST';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
page(_("Costed Bill Of Material Inquiry"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
-$path_to_root="../..";
+$page_security = 'SA_WORKORDERANALYTIC';
+$path_to_root = "../..";
include($path_to_root . "/includes/db_pager.inc");
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 9;
-$path_to_root="../..";
+$page_security = 'SA_BOM';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
page(_("Bill Of Materials"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="../..";
+$page_security = 'SA_WORKCENTRES';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Work Centres"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
-$path_to_root="..";
+$page_security = 'SA_MANUFTRANSVIEW';
+$path_to_root = "..";
include($path_to_root . "/includes/db_pager.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 10;
-$path_to_root="../..";
+$page_security = 'SA_MANUFTRANSVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
$js = "";
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 10;
-$path_to_root="../..";
+$page_security = 'SA_MANUFTRANSVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 10;
-$path_to_root="../..";
+$page_security = 'SA_MANUFTRANSVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 10;
-$path_to_root="..";
+$page_security = 'SA_MANUFRECEIVE';
+$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 10;
-$path_to_root="..";
+$page_security = 'SA_WORKORDERCOST';
+$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 10;
-$path_to_root="..";
+$page_security = 'SA_WORKORDERENTRY';
+$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="..";
+$page_security = 'SA_MANUFISSUE';
+$path_to_root = "..";
include_once($path_to_root . "/includes/ui/items_cart.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 10;
-$path_to_root="..";
+$page_security = 'SA_MANUFRELEASE';
+$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$path_to_root="../..";
-$page_security = 3;
+$page_security = 'SA_SUPPLIERALLOC';
+$path_to_root = "../..";
include($path_to_root . "/includes/ui/allocation_cart.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$path_to_root="../..";
-$page_security = 3;
+$page_security = 'SA_SUPPLIERALLOC';
+$path_to_root = "../..";
include($path_to_root . "/includes/db_pager.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
-$path_to_root="../..";
+$page_security = 'SA_SUPPTRANSVIEW';
+$path_to_root = "../..";
include($path_to_root . "/includes/db_pager.inc");
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_SUPPTRANSVIEW';
$path_to_root="../..";
include($path_to_root . "/includes/db_pager.inc");
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security=2;
-$path_to_root="../..";
+$page_security = 'SA_SUPPLIERALLOC';
+$path_to_root = "../..";
include($path_to_root . "/includes/db_pager.inc");
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security=2;
-$path_to_root="../..";
+$page_security = 'SA_SUPPTRANSVIEW';
+$path_to_root = "../..";
include($path_to_root . "/includes/db_pager.inc");
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security=5;
-$path_to_root="../..";
+$page_security = 'SA_SUPPLIER';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Suppliers"), @$_REQUEST['popup']);
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 4;
-$path_to_root="..";
+$page_security = 'SA_PURCHASEORDER';
+$path_to_root = "..";
include_once($path_to_root . "/purchasing/includes/po_class.inc");
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/purchasing/includes/purchasing_ui.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 11;
-$path_to_root="..";
+$page_security = 'SA_GRN';
+$path_to_root = "..";
include_once($path_to_root . "/purchasing/includes/po_class.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$path_to_root="..";
+$page_security = 'SA_SUPPLIERCREDIT';
+$path_to_root = "..";
include_once($path_to_root . "/purchasing/includes/supp_trans_class.inc");
-$page_security=5;
-
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/data_checks.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security=5;
-$path_to_root="..";
+$page_security = 'SA_SUPPLIERINVOICE';
+$path_to_root = "..";
include_once($path_to_root . "/purchasing/includes/purchasing_db.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$path_to_root="..";
-$page_security = 5;
+$page_security = 'SA_SUPPLIERPAYMNT';
+$path_to_root = "..";
include_once($path_to_root . "/includes/ui/allocation_cart.inc");
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
-$path_to_root="../..";
+$page_security = 'SA_SUPPTRANSVIEW';
+$path_to_root = "../..";
include($path_to_root . "/purchasing/includes/po_class.inc");
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
-$path_to_root="../..";
+$page_security = 'SA_SUPPTRANSVIEW';
+$path_to_root = "../..";
include($path_to_root . "/purchasing/includes/po_class.inc");
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
-$path_to_root="../..";
+$page_security = 'SA_SUPPTRANSVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/purchasing/includes/purchasing_db.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
-$path_to_root="../..";
+$page_security = 'SA_SUPPTRANSVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/purchasing/includes/purchasing_db.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
-$path_to_root="../..";
+$page_security = 'SA_SUPPTRANSVIEW';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 8;
//include_once($path_to_root . "reporting/includes/class.pdf.inc");
include_once(dirname(__FILE__)."/class.pdf.inc");
include_once(dirname(__FILE__)."/printer_class.inc");
print button in reporting module.
*/
$path_to_root = "..";
-$page_security = 2; // this level is later overriden in rep file
+$page_security = 'SA_OPEN'; // this level is later overriden in rep file
include_once($path_to_root . "/includes/session.inc");
if (isset($_GET['xls']))
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_CUSTPAYMREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_CUSTPAYMREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_CUSTBULKREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_PRICEREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_SALESBULKREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_SALESMANREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
// date_: 2005-05-19
-// Title: Order Status List
+// Title: Salesman Report
// ----------------------------------------------------------------
$path_to_root="..";
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = $_POST['PARAM_0'] == $_POST['PARAM_1'] ?
+ 'SA_SALESTRANSVIEW' : 'SA_SALESBULKREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
function print_invoices()
{
global $path_to_root;
-
+
include_once($path_to_root . "/reporting/includes/pdf_report.inc");
$from = $_POST['PARAM_0'];
$to = 0;
$dec = user_price_dec();
- $fno = explode("-", $from);
+ $fno = explode("-", $from);
$tno = explode("-", $to);
$cols = array(4, 60, 225, 300, 325, 385, 450, 515);
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_CUSTSTATREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = $_POST['PARAM_0'] == $_POST['PARAM_1'] ?
+ 'SA_SALESTRANSVIEW' : 'SA_SALESBULKREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = $_POST['PARAM_0'] == $_POST['PARAM_1'] ?
+ 'SA_SALESTRANSVIEW' : 'SA_SALESBULKREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Janusz Dobrwolski
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_SUPPLIERANALYTIC';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_SUPPLIERANALYTIC';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_SUPPPAYMREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_SUPPLIERANALYTIC';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+
+$page_security = $_POST['PARAM_0'] == $_POST['PARAM_1'] ?
+ 'SA_SUPPTRANSVIEW' : 'SA_SUPPBULKREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_ITEMSVALREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
// date_: 2005-05-19
-// Title: Supplier Balances
+// Title: Inventory Valuation
// ----------------------------------------------------------------
$path_to_root="..";
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_ITEMSANALYTIC';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_ITEMSVALREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_SALESANALYTIC';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
// date_: 2005-05-19
-// Title: Inventory Planning
+// Title: Inventory Sales Report
// ----------------------------------------------------------------
$path_to_root="..";
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_SUPPLIERANALYTIC';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_BOMREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = $_POST['PARAM_0'] == $_POST['PARAM_1'] ?
+ 'SA_MANUFTRANSVIEW' : 'SA_MANUFBULKREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
-// Creator: Janusz Dobrwolski
+// Creator: Janusz Dobrowolski
// date_: 2008-01-14
// Title: Print Workorders
// draft version!
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_DIMENSIONREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_BANKREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_GLREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_GLANALYTIC';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_GLREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_GLANALYTIC';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_GLANALYTIC';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_GLANALYTIC';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_GLANALYTIC';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_TAXREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 15;
+$page_security = 'SA_GLANALYTIC';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$path_to_root="..";
-$page_security = 5;
+$page_security = 'SA_OPEN';
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$path_to_root="../..";
-$page_security = 3;
+$page_security = 'SA_SALESALLOC';
+$path_to_root = "../..";
include($path_to_root . "/includes/ui/allocation_cart.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$path_to_root="../..";
-$page_security = 3;
+$page_security = 'SA_SALESALLOC';
+$path_to_root = "../..";
include($path_to_root . "/includes/db_pager.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="..";
+$page_security = 'SA_SALESINVOICE';
+$path_to_root = "..";
include_once($path_to_root . "/sales/includes/cart_class.inc");
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/sales/includes/ui/sales_order_ui.inc");
//
// Entry/Modify free hand Credit Note
//
-$page_security = 3;
-$path_to_root="..";
+$page_security = 'SA_SALESCREDIT';
+$path_to_root = "..";
include_once($path_to_root . "/sales/includes/cart_class.inc");
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/data_checks.inc");
// Entry/Modify Credit Note for selected Sales Invoice
//
-$page_security = 3;
+$page_security = 'SA_SALESCREDITINV';
$path_to_root = "..";
include_once($path_to_root . "/sales/includes/cart_class.inc");
//
// Entry/Modify Delivery Note against Sales Order
//
-$page_security = 2;
-$path_to_root="..";
+$page_security = 'SA_SALESDELIVERY';
+$path_to_root = "..";
include_once($path_to_root . "/sales/includes/cart_class.inc");
include_once($path_to_root . "/includes/session.inc");
// Entry/Modify Sales Invoice against single delivery
// Entry/Modify Batch Sales Invoice against batch of deliveries
//
-$page_security = 2;
-$path_to_root="..";
+$page_security = 'SA_SALESINVOICE';
+$path_to_root = "..";
include_once($path_to_root . "/sales/includes/cart_class.inc");
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/data_checks.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$path_to_root="..";
-$page_security = 3;
+$page_security = 'SA_SALESPAYMNT';
+$path_to_root = "..";
include_once($path_to_root . "/includes/ui/allocation_cart.inc");
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
-$path_to_root="../..";
+$page_security = 'SA_SALESALLOC';
+$path_to_root = "../..";
include($path_to_root . "/includes/db_pager.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
-$path_to_root="../..";
+$page_security = 'SA_SALESTRANSVIEW';
+$path_to_root = "../..";
include($path_to_root . "/includes/db_pager.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
-$path_to_root="../..";
+$page_security = 'SA_SALESTRANSVIEW';
+$path_to_root = "../..";
include($path_to_root . "/includes/db_pager.inc");
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
-$path_to_root="../..";
+$page_security = 'SA_STEMPLATE';
+$path_to_root = "../..";
include($path_to_root . "/includes/db_pager.inc");
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="../..";
+$page_security = 'SA_CRSTATUS';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Credit Status"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="../..";
+$page_security = 'SA_CUSTOMER';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Customer Branches"), @$_REQUEST['popup']);
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="../..";
+$page_security = 'SA_CUSTOMER';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
page(_("Customers"), @$_REQUEST['popup']);
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="../..";
+$page_security = 'SA_SRECURRENT';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
include($path_to_root . "/includes/ui.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="../..";
+$page_security = 'SA_SALESAREA';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Sales Areas"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="../..";
+$page_security = 'SA_SALESGROUP';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Sales Groups"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="../..";
+$page_security = 'SA_SALESMAN';
+$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
page(_("Sales Persons"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 15;
-$path_to_root="../..";
+$page_security = 'SA_POSSETUP';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
page(_("POS settings"));
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 14;
-$path_to_root="../..";
+$page_security = 'SA_SALESTYPES';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
page(_("Sales Types"));
// Entry Direct Invoice
//
-$page_security = 1;
-$path_to_root="..";
+$page_security = 'SA_SALESORDER';
+$path_to_root = "..";
include_once($path_to_root . "/sales/includes/cart_class.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
-$path_to_root="../..";
+$page_security = 'SA_SALESTRANSVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
-$path_to_root="../..";
+$page_security = 'SA_SALESTRANSVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/sales/includes/sales_ui.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
-$path_to_root="../..";
+$page_security = 'SA_SALESTRANSVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/sales/includes/sales_ui.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 1;
-$path_to_root="../..";
+$page_security = 'SA_SALESTRANSVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
-$path_to_root="../..";
+$page_security = 'SA_SALESTRANSVIEW';
+$path_to_root = "../..";
include_once($path_to_root . "/sales/includes/cart_class.inc");
include_once($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
+
class fa2_2 {
var $version = '2.2'; // version installed
var $description = 'Version 2.2';
}
}
*/
- return true;
+ return convert_roles($pref);
}
//
// Checking before install
//
function pre_check($pref)
{
- return true; // true when ok, fail otherwise
+ global $security_groups;
+ return isset($security_groups); // true when ok, fail otherwise
}
//
// Test if patch was applied before.
if (check_table($pref, 'users', 'sticky_doc_date')) return false;
if (check_table($pref, 'audit_trail')) return false;
if (check_table($pref, 'stock_master','no_sale')) return false;
+ if (check_table($pref, 'users', 'role_id')) return false;
return true;
}
};
+/*
+ Conversion of old security roles stored into $security_groups table
+*/
+function convert_roles($pref)
+{
+ global $security_groups, $security_headings, $security_areas, $path_to_root;
+ include_once($path_to_root."/includes/access_levels.inc");
+
+ $trans_sec = array(
+ 1 => array('SA_CHGPASSWD', 'SA_SETUPDISPLAY', 'SA_BANKTRANSVIEW',
+ 'SA_ITEMSTRANSVIEW','SA_SUPPTRANSVIEW', 'SA_SALESORDER',
+ 'SA_SALESALLOC', 'SA_SALESTRANSVIEW'),
+ 2 => array('SA_DIMTRANSVIEW', 'SA_STANDARDCOST', 'SA_ITEMSTRANSVIEW',
+ 'SA_ITEMSSTATVIEW', 'SA_SALESPRICE', 'SA_MANUFTRANSVIEW',
+ 'SA_WORKORDERANALYTIC', 'SA_WORKORDERCOST', 'SA_SUPPTRANSVIEW',
+ 'SA_SUPPLIERALLOC', 'SA_STEMPLATE', 'SA_SALESTRANSVIEW',
+ 'SA_SALESINVOICE', 'SA_SALESDELIVERY', 'SA_CUSTPAYMREP',
+ 'SA_CUSTBULKREP', 'SA_PRICEREP', 'SA_SALESBULKREP', 'SA_SALESMANREP',
+ 'SA_SALESBULKREP', 'SA_CUSTSTATREP', 'SA_SUPPLIERANALYTIC',
+ 'SA_SUPPPAYMREP', 'SA_SUPPBULKREP', 'SA_ITEMSVALREP', 'SA_ITEMSANALYTIC',
+ 'SA_BOMREP', 'SA_MANUFBULKREP', 'SA_DIMENSIONREP', 'SA_BANKREP', 'SA_GLREP',
+ 'SA_GLANALYTIC', 'SA_TAXREP', 'SA_SALESANALYTIC'),
+ 3 => array('SA_GLACCOUNTGROUP', 'SA_GLACCOUNTCLASS','SA_PAYMENT',
+ 'SA_DEPOSIT', 'SA_JOURNALENTRY', 'SA_INVENTORYMOVETYPE',
+ 'SA_LOCATIONTRANSFER', 'SA_INVENTORYADJUSTMENT', 'SA_WORKCENTRES',
+ 'SA_MANUFISSUE', 'SA_SUPPLIERALLOC', 'SA_CUSTOMER', 'SA_CRSTATUS',
+ 'SA_SALESMAN', 'SA_SALESAREA', 'SA_SALESALLOC', 'SA_SALESCREDITINV',
+ 'SA_SALESPAYMNT', 'SA_SALESCREDIT', 'SA_SALESGROUP', 'SA_SRECURRENT',
+ 'SA_TAXRATES', 'SA_ITEMTAXTYPE', 'SA_TAXGROUPS', 'SA_QUICKENTRY'),
+ 4 => array('SA_REORDER', 'SA_PURCHASEPRICING', 'SA_PURCHASEORDER'),
+ 5 => array('SA_VIEWPRINTTRANSACTION', 'SA_BANKTRANSFER', 'SA_SUPPLIER',
+ 'SA_SUPPLIERINVOICE', 'SA_SUPPLIERPAYMNT', 'SA_SUPPLIERCREDIT'),
+ 8 => array('SA_ATTACHDOCUMENT', 'SA_RECONCILE', 'SA_GLANALYTIC',
+ 'SA_TAXREP', 'SA_BANKTRANSVIEW', 'SA_GLTRANSVIEW'),
+ 9 => array('SA_FISCALYEARS', 'SA_CURRENCY', 'SA_EXCHANGERATE',
+ 'SA_BOM'),
+ 10 => array('SA_PAYTERMS', 'SA_GLSETUP', 'SA_SETUPCOMPANY',
+ 'SA_FORMSETUP', 'SA_DIMTRANSVIEW', 'SA_DIMENSION', 'SA_BANKACCOUNT',
+ 'SA_GLACCOUNT', 'SA_BUDGETENTRY', 'SA_MANUFRECEIVE',
+ 'SA_MANUFRELEASE', 'SA_WORKORDERENTRY', 'SA_MANUFTRANSVIEW',
+ 'SA_WORKORDERCOST'),
+ 11 => array('SA_ITEMCATEGORY', 'SA_ITEM', 'SA_UOM', 'SA_INVENTORYLOCATION',
+ 'SA_GRN', 'SA_FORITEMCODE', 'SA_SALESKIT'),
+ 14 => array('SA_SHIPPING', 'SA_VOIDTRANSACTION', 'SA_SALESTYPES'),
+ 15 => array('SA_PRINTERS', 'SA_PRINTPROFILE', 'SA_BACKUP', 'SA_USERS',
+ 'SA_POSSETUP'),
+ 20 => array('SA_CREATECOMPANY', 'SA_CREATELANGUAGE', 'SA_CREATEMODULES',
+ 'SA_SOFTWAREUPGRADE', 'SA_SECROLES')
+ );
+
+ foreach ($security_groups as $role_id => $areas) {
+ $area_set = array();
+ $sections = array();
+ foreach ($areas as $a) {
+ if (isset($trans_sec[$a]))
+ foreach ($trans_sec[$a] as $id) {
+ if ($security_areas[$id][0]==0)
+// error_log('invalid area id: '.$a.':'.$id);
+ $area_set[] = $security_areas[$id][0];
+ $sections[$security_areas[$id][0]&~0xff] = 1;
+ }
+ }
+ $sections = array_keys($sections);
+ sort($sections); sort($area_set);
+ import_security_role($pref, $security_headings[$role_id], $sections, $area_set);
+ $new = db_insert_id();
+ $sql = "UPDATE {$pref}users set role_id=$new WHERE role_id=$role_id";
+ $ret = db_query($sql, 'cannot update users roles');
+ if(!$ret) return false;
+ }
+ return true;
+}
+
+function import_security_role($pref, $name, $sections, $areas)
+{
+ $sql = "INSERT INTO {$pref}security_roles (role, description, sections, areas)
+ VALUES (".db_escape('FA 2.1 '.$name).",".db_escape($name).","
+ .db_escape(implode(';',$sections)).",".db_escape(implode(';',$areas)).")";
+
+ db_query($sql, "could not add new security role");
+}
+
$install = new fa2_2;
+
?>
\ No newline at end of file
ALTER TABLE `0_stock_category` ADD COLUMN `dflt_no_sale` tinyint(1) NOT NULL default '0';
ALTER TABLE `0_users` ADD COLUMN `sticky_doc_date` TINYINT(1) DEFAULT '0';
-ALTER TABLE `0_users` ADD COLUMN `startup_tab` VARCHAR(20) NOT NULL default '' AFTER sticky_doc_date;
+ALTER TABLE `0_users` ADD COLUMN `startup_tab` VARCHAR(20) NOT NULL default 'orders' AFTER `sticky_doc_date`;
ALTER TABLE `0_debtors_master` MODIFY COLUMN `name` varchar(100) NOT NULL default '';
ALTER TABLE `0_cust_branch` ADD COLUMN `inactive` tinyint(1) NOT NULL default '0';
ALTER TABLE `0_sys_types` DROP COLUMN `type_name`;
-ALTER TABLE `0_chart_class` DROP COLUMN `sign_convert`;
+
ALTER TABLE `0_chart_class` CHANGE `balance_sheet` `ctype` TINYINT(1) NOT NULL DEFAULT '0';
ALTER TABLE `0_chart_class` ADD COLUMN `inactive` tinyint(1) NOT NULL default '0';
ALTER TABLE `0_item_tax_types` ADD COLUMN `inactive` tinyint(1) NOT NULL default '0';
ALTER TABLE `0_tax_types` ADD COLUMN `inactive` tinyint(1) NOT NULL default '0';
ALTER TABLE `0_tax_groups` ADD COLUMN `inactive` tinyint(1) NOT NULL default '0';
-ALTER TABLE `0_tax_group_items` DROP COLUMN `included_in_price`;
ALTER TABLE `0_users` DROP PRIMARY KEY;
ALTER TABLE `0_users` ADD `id` SMALLINT(6) AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `0_cust_branch` ADD COLUMN `branch_ref` varchar(30) NOT NULL;
UPDATE `0_cust_branch` SET `branch_ref`=`br_name` WHERE 1;
+DROP TABLE IF EXISTS `0_security_roles`;
+
CREATE TABLE `0_security_roles` (
`id` int(11) NOT NULL auto_increment,
- `role` varchar(20) NOT NULL,
+ `role` varchar(30) NOT NULL,
`description` varchar(50) default NULL,
- `modules` text,
+ `sections` text,
`areas` text,
`inactive` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`),
) TYPE=MyISAM AUTO_INCREMENT=8 AUTO_INCREMENT=8 ;
ALTER TABLE `0_company` ADD COLUMN `login_tout` SMALLINT(6) NOT NULL DEFAULT '600';
+ALTER TABLE `0_users` CHANGE COLUMN `full_access` `role_id` int(11) NOT NULL default '1';
+
`user_id` varchar(60) NOT NULL default '',
`password` varchar(100) NOT NULL default '',
`real_name` varchar(100) NOT NULL default '',
- `full_access` int(11) NOT NULL default '1',
+ `role_id` int(11) NOT NULL default '1',
`phone` varchar(30) NOT NULL default '',
`email` varchar(100) default NULL,
`language` varchar(20) default NULL,
`user_id` varchar(60) NOT NULL default '',
`password` varchar(100) NOT NULL default '',
`real_name` varchar(100) NOT NULL default '',
- `full_access` int(11) NOT NULL default '1',
+ `role_id` int(11) NOT NULL default '1',
`phone` varchar(30) NOT NULL default '',
`email` varchar(100) default NULL,
`language` varchar(20) default NULL,
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
+$page_security = 'SA_ITEMTAXTYPE';
$path_to_root = "..";
-$page_security = 3;
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="..";
+$page_security = 'SA_TAXGROUPS';
+$path_to_root = "..";
include($path_to_root . "/includes/session.inc");
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 3;
-$path_to_root="..";
+$page_security = 'SA_TAXRATES';
+$path_to_root = "..";
include($path_to_root . "/includes/session.inc");
page(_("Tax Types"));