]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
don't allow fullscreen for youtube iframe - this makes it hard to visit the network...
[friendica.git] / boot.php
index 3d1d884e308750c40bffbfffc7426d7b160368e3..e897f19aa12b21151bf8eb0d1f61e536da0fd8e1 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -7,13 +7,13 @@ require_once('include/text.php');
 require_once("include/pgettext.php");
 
 
-define ( 'FRIENDIKA_VERSION',      '2.2.1061' );
+define ( 'FRIENDIKA_VERSION',      '2.2.1083' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
-define ( 'DB_UPDATE_VERSION',      1077      );
+define ( 'DB_UPDATE_VERSION',      1082      );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
-define ( 'DOWN_ARROW',             '&#x21e9;'       );
+
 
 /**
  *
@@ -55,13 +55,12 @@ define ( 'REGISTER_OPEN',          2 );
 
 /**
  * relationship types
- * When used in contact records, this indicates that 'uid' has 
- * this relationship with contact['name']
  */
 
-define ( 'REL_VIP',        1);     // other person is 'following' us
-define ( 'REL_FAN',        2);     // we are 'following' other person
-define ( 'REL_BUD',        3);     // mutual relationship
+define ( 'CONTACT_IS_FOLLOWER', 1);
+define ( 'CONTACT_IS_SHARING',  2);
+define ( 'CONTACT_IS_FRIEND',   3);
+
 
 /**
  * Hook array order
@@ -76,10 +75,10 @@ define ( 'HOOK_FUNCTION',  2);
  * page/profile types
  *
  * PAGE_NORMAL is a typical personal profile account
- * PAGE_SOAPBOX automatically approves all friend requests as REL_FAN, (readonly)
- * PAGE_COMMUNITY automatically approves all friend requests as REL_FAN, but with 
+ * PAGE_SOAPBOX automatically approves all friend requests as CONTACT_IS_SHARING, (readonly)
+ * PAGE_COMMUNITY automatically approves all friend requests as CONTACT_IS_SHARING, but with 
  *      write access to wall and comments (no email and not included in page owner's ACL lists)
- * PAGE_FREELOVE automatically approves all friend requests as full friends (REL_BUD). 
+ * PAGE_FREELOVE automatically approves all friend requests as full friends (CONTACT_IS_FRIEND). 
  *
  */
 
@@ -283,7 +282,12 @@ class App {
                                $this->path = $path;
                }
 
-               set_include_path("include/$this->hostname" . PATH_SEPARATOR . 'include' . PATH_SEPARATOR . '.' );
+               set_include_path(
+                       "include/$this->hostname" . PATH_SEPARATOR 
+                       . 'include' . PATH_SEPARATOR 
+                       . 'library' . PATH_SEPARATOR 
+                       . 'library/phpsec' . PATH_SEPARATOR 
+                       . '.' );
 
                if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=")
                        $this->query_string = substr($_SERVER['QUERY_STRING'],2);
@@ -320,13 +324,12 @@ class App {
 
                /**
                 * Special handling for the webfinger/lrdd host XRD file
-                * Just spit out the contents and exit.
                 */
 
                if($this->cmd === '.well-known/host-meta') {
-                       require_once('include/hostxrd.php');
-                       hostxrd();
-                       // NOTREACHED
+                       $this->argc = 1;
+                       $this->argv = array('hostxrd');
+                       $this->module = 'hostxrd';
                }
 
                /**
@@ -607,6 +610,18 @@ function check_config(&$a) {
 }}
 
 
+function get_guid($size=16) {
+       $exists = true; // assume by default that we don't have a unique guid
+       do {
+               $s = random_string($size);
+               $r = q("select id from guid where guid = '%s' limit 1", dbesc($s));
+               if(! count($r))
+                       $exists = false;
+       } while($exists);
+       q("insert into guid ( guid ) values ( '%s' ) ", dbesc($s));
+       return $s;
+}
+
 
 // wrapper for adding a login box. If $register == true provide a registration
 // link. This will most always depend on the value of $a->config['register_policy'].
@@ -788,8 +803,12 @@ function profile_load(&$a, $nickname, $profile = 0) {
        if(! (x($a->page,'aside')))
                $a->page['aside'] = '';
 
-       $a->page['aside'] .= profile_sidebar($a->profile);
-       $a->page['aside'] .= contact_block();
+       $block = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
+
+       $a->page['aside'] .= profile_sidebar($a->profile, $block);
+
+       if(! $block)
+               $a->page['aside'] .= contact_block();
 
        return;
 }}
@@ -812,7 +831,7 @@ function profile_load(&$a, $nickname, $profile = 0) {
 
 
 if(! function_exists('profile_sidebar')) {
-function profile_sidebar($profile) {
+function profile_sidebar($profile, $block = 0) {
 
        $a = get_app();
 
@@ -831,10 +850,9 @@ function profile_sidebar($profile) {
 
        $tabs = '';
 
-       $photo = '<div id="profile-photo-wrapper"><img class="photo" src="' . $profile['photo'] . '" alt="' . $profile['name'] . '" /></div>';
+       $photo = '<div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="' . $profile['photo'] . '" alt="' . $profile['name'] . '" /></div>';
 
        // don't show connect link to yourself
-       
        $connect = (($profile['uid'] != local_user()) ? '<li><a id="dfrn-request-link" href="dfrn_request/' . $profile['nickname'] . '">' . t('Connect') . '</a></li>' : '');
 
        // don't show connect link to authenticated visitors either
@@ -862,6 +880,7 @@ function profile_sidebar($profile) {
 
        }
 
+
        $gender = ((x($profile,'gender') == 1) ? '<div class="mf"><span class="gender-label">' . t('Gender:') . '</span> <span class="x-gender">' . $profile['gender'] . '</span></div><div class="profile-clear"></div>' : '');
 
        $pubkey = ((x($profile,'pubkey') == 1) ? '<div class="key" style="display:none;">' . $profile['pubkey'] . '</div>' : '');
@@ -870,13 +889,13 @@ function profile_sidebar($profile) {
 
        $homepage = ((x($profile,'homepage') == 1) ? '<div class="homepage"><span class="homepage-label">' . t('Homepage:') . ' </span><span class="homepage-url">' . linkify($profile['homepage']) . '</span></div><div class="profile-clear"></div>' : '');
 
-       if($profile['hidewall'] && (! local_user()) && (! remote_user())) {
-               $location = $gender = $marital = $homepage = '';
+       if(($profile['hidewall'] || $block) && (! local_user()) && (! remote_user())) {
+               $location = $pdesc = $connect = $gender = $marital = $homepage = '';
        }
 
        $podloc = $a->get_baseurl();
        $searchable = (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' );
-       $nickname = $profile['nick'];
+       $nickname = $profile['nickname'];
        $photo300 = $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg';
        $photo100 = $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg';
        $photo50  = $a->get_baseurl() . '/photo/custom/50/'  . $profile['uid'] . '.jpg';
@@ -887,13 +906,19 @@ function profile_sidebar($profile) {
 <dl class='entity_nickname'>
 <dt>Nickname</dt>
 <dd>
-<a class="nickname url uid" href="$podloc" rel="me">$nickname</a>
+<a class="nickname url uid" href="$podloc/" rel="me">$nickname</a>
+</dd>
+</dl>
+<dl class='entity_fn'>
+<dt>Full name</dt>
+<dd>
+<span class='fn'>$fullname</span>
 </dd>
 </dl>
 <dl class="entity_url">
 <dt>URL</dt>
 <dd>
-<a class="url" href="$podloc" id="pod_location" rel="me">$podloc</a>
+<a class="url" href="$podloc/" id="pod_location" rel="me">$podloc/</a>
 </dd>
 </dl>
 <dl class="entity_photo">
@@ -914,10 +939,10 @@ function profile_sidebar($profile) {
 <img class="photo avatar" height="50px" width="50px" src="$photo50">
 </dd>
 </dl>
-<dl class='entity_searchable'>
+<dl class="entity_searchable">
 <dt>Searchable</dt>
 <dd>
-<span class='searchable'>$searchable</span>
+<span class="searchable">$searchable</span>
 </dd>
 </dl>
 </div>
@@ -1018,11 +1043,14 @@ function proc_run($cmd){
        $a = get_app();
 
        $args = func_get_args();
-       call_hooks("proc_run", $args);
+       $arr = array('args' => $args, 'run_cmd' => true);
+
+       call_hooks("proc_run", $arr);
+       if(! $arr['run_cmd'])
+               return;
 
        if(count($args) && $args[0] === 'php')
         $args[0] = ((x($a->config,'php_path')) && (strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
-       
        foreach ($args as $arg){
                $arg = escapeshellarg($arg);
        }