source: trunk/junk/userpage-fix.php @ 1184

Revision 997, 928 bytes checked in by strat.cristian@…, 3 years ago (diff)

Log remote IP and X-Forwarded-For header on job submit, textblock create/edit, and attachment upload. For privacy considerations, IP addresses are only displayed to admins and helpers.

  • Contains database migration script.
  • Adds new simplified security action. (sensitive-info)
  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1#! /usr/bin/env php
2<?php
3
4require_once(dirname($argv[0]) . "/config.php");
5require_once(IA_ROOT_DIR . "common/common.php");
6require_once(IA_ROOT_DIR . "common/log.php");
7require_once(IA_ROOT_DIR . "common/db/smf.php");
8require_once(IA_ROOT_DIR . "common/textblock.php");
9require_once(IA_ROOT_DIR . "common/db/textblock.php");
10require_once(IA_ROOT_DIR . "common/db/user.php");
11db_connect();
12
13$query = <<<SQL
14SELECT *
15    FROM `ia_user`
16SQL;
17
18$users = db_fetch_all($query);
19foreach ($users as $user) {
20    $tbname = IA_USER_TEXTBLOCK_PREFIX.'/'.$user['username'];
21    if (is_normal_page_name($tbname)) {
22        if (!textblock_get_revision($tbname)) {
23            log_print("Missing textblock for {$user['username']}");
24            $replace = array("user_id" => $user['username']);
25            textblock_copy_replace("template/newuser", $tbname, $replace,
26                    "public", $user['id'], null);
27        }
28    }
29}
30
31?>
32
Note: See TracBrowser for help on using the repository browser.