]> git.mxchange.org Git - friendica.git/blobdiff - mod/delegate.php
Merge pull request #2135 from rabuzarus/doxygen
[friendica.git] / mod / delegate.php
index 56d11970fe7d3dfadf9335f1ad69bb4c04e5b12a..20d2e605e0a2d91c90e1d664567037d6baf1902d 100644 (file)
@@ -1,4 +1,10 @@
 <?php
+require_once('mod/settings.php');
+
+function delegate_init(&$a) {
+       return settings_init($a);
+}
+
 
 function delegate_content(&$a) {
 
@@ -54,8 +60,7 @@ function delegate_content(&$a) {
 
        // These people can manage this account/page with full privilege
 
-       $r = q("SELECT * FROM `user` WHERE `uid` = %d AND `email` = '%s' AND `password` = '%s' LIMIT 1",
-               intval(local_user()),
+       $r = q("SELECT * FROM `user` WHERE `email` = '%s' AND `password` = '%s' ",
                dbesc($a->user['email']),
                dbesc($a->user['password'])
        );
@@ -87,7 +92,7 @@ function delegate_content(&$a) {
 
        $r = q("select nurl from contact where substring_index(contact.nurl,'/',3) = '%s' 
                and contact.uid = %d and contact.self = 0 and network = '%s' ",
-               dbesc($a->get_baseurl()),
+               dbesc(normalise_link($a->get_baseurl())),
                intval(local_user()),
                dbesc(NETWORK_DFRN)
        ); 
@@ -118,6 +123,9 @@ function delegate_content(&$a) {
                        if(! in_array($rr['uid'],$uids))
                                $potentials[] = $rr;
 
+       require_once("mod/settings.php");
+       settings_init($a);
+
        $o = replace_macros(get_markup_template('delegate.tpl'),array(
                '$header' => t('Delegate Page Management'),
                '$base' => $a->get_baseurl(),
@@ -137,4 +145,4 @@ function delegate_content(&$a) {
        return $o;
 
 
-}
\ No newline at end of file
+}