function loadValidators($dir, $table, $sys) { $validators = array(); foreach (as_find_files($dir, '/^' . $table . '\\.([a-zA-Z0-9_]*)\\.validator\\.php$/') as $file => $matches) { include_once $dir . $file; $clsname = $table . '_' . $matches[1] . 'Validator'; if (class_exists($clsname)) { $cls = new $clsname($sys); if (is_a($cls, 'BaseValidator')) { $validators[] = $cls; } } } return $validators; }
$role_list = array('ASR_DOWNLOADER' => array('GetVersion', 'Login', 'GetPartView', 'GetShopInfo', 'GetFileSize', 'DownloadFile', 'GetRecordCount', 'DownloadRecord')); LogUtils::log_str('methodname:' . $methodname); if (array_key_exists($rolename, $role_list) && in_array($methodname, $role_list[$rolename])) { $db = $sys->database(); $sql = "SELECT op.userpass FROM sdb_lnk_roles lr\n inner join sdb_operators op on lr.op_id=op.op_id\n inner join sdb_admin_roles r on lr.role_id=r.role_id\n where op.disabled='false' and op.status=1 and r.disabled='false' and\n r.role_name=" . $db->quote($rolename) . " and op.username="******"md5") { return md5($body . strtolower($row['userpass'])) == $signature; } } } return false; } foreach (as_find_files(AS_SERVICE_DIR, '/service.([a-zA-Z0-9_]*).php/') as $file => $matches) { include_once AS_SERVICE_DIR . $file; $clsname = $matches[1] . 'Service'; if (class_exists($clsname)) { $cls = new $clsname(); if (is_a($cls, 'BaseService')) { $cls->init($server); } } } $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : ''; if (empty($HTTP_RAW_POST_DATA)) { $fp = fopen("php://input", 'rb'); while (!feof($fp)) { $HTTP_RAW_POST_DATA .= fread($fp, 4096); }