aboutsummaryrefslogblamecommitdiffstats
path: root/Zotlabs/Update/_1242.php
blob: 0a4265984beb08426ee2e23f8acdd869ee3c8e14 (plain) (tree)
1
2
3
4
5
6



                         

                       







                                                                            
                                                                                                       






                                                                                                     
 
<?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;
	}

}