From: <var...@us...> - 2015-02-11 17:19:09
|
Revision: 9526 http://sourceforge.net/p/phpwiki/code/9526 Author: vargenau Date: 2015-02-11 17:19:01 +0000 (Wed, 11 Feb 2015) Log Message: ----------- You must be logged in to add blog entries. Modified Paths: -------------- trunk/PhpWiki.wsdl trunk/lib/plugin/WikiBlog.php Modified: trunk/PhpWiki.wsdl =================================================================== --- trunk/PhpWiki.wsdl 2015-02-11 16:08:34 UTC (rev 9525) +++ trunk/PhpWiki.wsdl 2015-02-11 17:19:01 UTC (rev 9526) @@ -360,7 +360,7 @@ <service name="wikiService"> <port name="wikiPortType" binding="tns:wikiBinding"> - <soap:address location="http://phpwiki.fr/SOAP.php" /> + <soap:address location="http://phpwiki.nmu.alcatel.fr/phpwiki/SOAP.php" /> </port> </service> </definitions> Modified: trunk/lib/plugin/WikiBlog.php =================================================================== --- trunk/lib/plugin/WikiBlog.php 2015-02-11 16:08:34 UTC (rev 9525) +++ trunk/lib/plugin/WikiBlog.php 2015-02-11 17:19:01 UTC (rev 9526) @@ -95,9 +95,6 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - // allow empty pagenames for ADMIN_USER style blogs: "Blog/day" - //if (!$args['pagename']) - // return $this->error(_("No pagename specified")); // Get our form args. $blog = $request->getArg("edit"); @@ -142,21 +139,20 @@ // This is similar to editpage. Shouldn't we use just this for preview? $parent = $posted['pagename']; if (empty($parent)) { - $prefix = ""; // allow empty parent for default "Blog/day" + $prefix = ''; // allow empty parent for default "Blog/day" $parent = HOME_PAGE; } elseif (($parent == 'Blog' or $parent == 'WikiBlog') and $type == 'wikiblog') { // avoid Blog/Blog/2003-01-11/14:03:02+00:00 - $prefix = ""; + $prefix = ''; $parent = ''; // 'Blog'; } elseif ($parent == 'Comment' and $type == "comment") { - $prefix = ""; + $prefix = ''; $parent = ''; // 'Comment'; } elseif ($parent == 'Forum' and $type == "wikiforum") { - $prefix = ""; + $prefix = ''; $parent = ''; // 'Forum'; } else { $prefix = $parent . '/'; } - //$request->finish(fmt("No pagename specified for %s",$type)); $now = time(); $dbi = $request->getDbh(); @@ -222,7 +218,9 @@ // Maybe add the BlogArchives plugin instead for the new interim subpage. $redirected = $prefix . $pagename; if (!$dbi->isWikiPage($redirected)) { - if (!$parent) $parent = HOME_PAGE; + if (!$parent) { + $parent = HOME_PAGE; + } require_once 'lib/loadsave.php'; $pageinfo = array('pagename' => $redirected, 'content' => '<<RedirectTo page="' . $parent . '">>', @@ -231,7 +229,7 @@ ); SavePage($request, $pageinfo, ''); } - $redirected = $prefix . $pagename . '/' . preg_replace("/T.*/", "", "$time"); + $redirected = $prefix . $pagename . '/' . preg_replace("/T.*/", '', "$time"); if (!$dbi->isWikiPage($redirected)) { if (!$parent) $parent = HOME_PAGE; require_once 'lib/loadsave.php'; @@ -350,7 +348,7 @@ function findBlogs(&$dbi, $basepage = '', $type = 'wikiblog') { $prefix = (empty($basepage) - ? "" + ? '' : $basepage . '/') . $this->blogPrefix($type); $pages = $dbi->titleSearch(new TextSearchQuery('"' . $prefix . '"', true, 'none')); @@ -374,6 +372,13 @@ function showForm(&$request, $args, $template = 'blogform') { + $user = $request->getUser(); + if (!($user->isSignedIn())) { + // Cannot create entry + return HTML::p(array('class' => 'warning'), + _('You must be logged in to add blog entries.')); + } + // Show blog-entry form. $args = array('PAGENAME' => $args['pagename'], 'HIDDEN_INPUTS' => This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |