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

namespace Zotlabs\Update;

use Zotlabs\Lib\Config;

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, Config::Get('system', 'prvkey'));
					set_pconfig($pp['uid'], $pp['cat'], $pp['k'], obscurify($v));
				}
			}
		}
		return UPDATE_SUCCESS;
	}

}