本站已从Drupal 9升级到Drupal 10
Drupal
https://drupal.stackexchange.com/questions/27965/ajax-callback-change-checked-radio-button
For Drupal 8+:
$inputs = $form_state->getUserInput(); unset($inputs[$item]); $form_state->setUserInput($inputs);
For Drupal 7:
unset($form['input'][$item]);
参考:https://www.drupal.org/node/30334
在Drupal的.htaccess似乎禁用了子目录,在.htaccess里增加以下几行可以允许指定目录被访问:
RewriteEngine on # # stuff to let through (ignore) RewriteCond %{REQUEST_URI} "/folder1/" [OR] RewriteCond %{REQUEST_URI} "/folder2/" RewriteRule (.*) $1 [L]
1. DroopeScan
扫描Drupal版本、安装模块,可找出潜在有漏洞的地方。
git clone https://github.com/droope/droopescan.git cd droopescan pip3 install -r requirements.txt ./droopescan scan zhiwei-tech.com/test/drupal9/
2. Nikto
寻找服务器漏洞。
nikto -h zhiwei-tech.com
3. Sqlmap
检测一个具体的URL有没有SQL注入漏洞,需要结合脚本收集URL集合来测试。
sqlmap -u https://zhiwei-tech.com/?q=search/content/test
4. Commix
后台命令执行漏洞测试。
5. xsser
XSS漏洞测试。
一家广州做Drupal开发的公司。
1. 管理匿名用户Form页面缓存
use Drupal\Core\Cache\Cache;
// 在匿名用户可以访问的表单里加入下面逻辑,包括列表页面和具体的查看页面
$form['#cache']['tags'] = ['your_custom_tag_name'];
// 在写入逻辑里让缓存失效
Cache::invalidateTags(['your_custom_tag_name']);
2. 禁用匿名用户Form页面缓存
在<module>.routing.yml文件路由定义里增加no_cache: 'TRUE'可禁用缓存
参考school_users_import
- 先安装一个RESTUI模块
- 启用配置好之后可以访问GET接口,例如:http://cto.eguidedog.net/node/241?_format=json
-
POST接口,例如:curl -H "Content-Type: application/json" -X POST -d '{"type":[{"target_id":"braille_printing_application"}],"title":[{"value":"test2"}],"field_address":[{"value":"addr2"}],"field_name":[{"value":"name2"}],"field_phone":[{"value":"phone2"}],"field_zipcode":[{"value":"zipcode2"}]}' http://cto.eguidedog.net/entity/node
如果表格数据全部来自数据库,可以直接使用Drupal 7的tablesort功能。
$header = array(
array('data' => '学号', 'field' => 'school_id'),
array('data' => '姓名', 'field' => 'name'),
array('data' => '班别', 'field' => 'class'),
array('data' => '操作'), // 此列不支持排序
);$query = db_select('cj3_exam_scores', 's')
$query->extend('TableSort')
->orderByHeader($header);
$result = $query->execute();$rows = ...; // 把$result的值填到$rows里
热门内容
最新内容
- 1 天 ago
- 5 天 20 小时 ago
- 1 周 ago
- 1 周 5 天 ago
- 1 周 6 天 ago
- 3 周 ago
- 3 周 2 天 ago
- 3 周 3 天 ago
- 1个月 ago
- 1个月 1 周 ago
最新评论