aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Update/_1242.php
blob: c2c9a66d004e5dce75e21eece00058a6e04acebc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

namespace Zotlabs\Update;

class _1242 {

	function run() {
		$p = dbq("SELECT * FROM pconfig WHERE k LIKE '%password%'");
		foreach ($p as $pp) {
			if ($pp['v'][0] === '{') {
				$a = json_decode($pp['v'], true);
				if (isset($a['encrypted'])) {
					$v = crypto_unencapsulate($a, get_config('system', 'prvkey'));
					set_pconfig($pp['uid'], $pp['cat'], $pp['k'], obscurify($v));
				}
			}
		}
		return UPDATE_SUCCESS;
	}

}