We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22098
    • 218 Posts
    Hello,

    is it possible to configure Jot so that a comment is only published after the poster has received a validation email with a link in it, which has to be clicked?

    Olaf
      • 33992 ☆ A M B ☆
      • 455 Posts
      Hello,

      The Jot part for publishing a comment is:
      <?php
      ....
      // Moderation
      function doModerate($action = '',$id = 0) {
      	$output = NULL;
      	$pObj = $this->provider;
      	if ($this->isModerator && $pObj->isValidComment($this->config["docid"],$this->config["tagid"],$id)) {
      		switch ($action) {
      			case "delete":
      				$pObj->Comment($id);
      				$pObj->Delete();
      				break;
      			case "publish":
      				$pObj->Comment($id);
      				$pObj->Set("publishedon",$this->_ctime);
      				$pObj->Set("publishedby",$this->config["user"]["id"]);
      				$pObj->Set("published",1);
      				$pObj->Save();
      				$this->doNotifySubscribers($id);
      				break;
      			case "edit":
      ....
      ?>


      Jot does moderation actions only when current user is moderator.
      You should create a new method to check referer headers and validate that the link has been clicked in poster’s inbox.... So after it, the publishing link is the normal publish link in moderation.
      <?php
      ....
      // Moderation
      function doModerate($action = '',$id = 0) {
      	$output = NULL;
      	$pObj = $this->provider;
      ////////////////////////////////////
      	if(! $this->isModerator)
      		if(! $this->validateRefererEmail())
      			return;
      	
      	if ($pObj->isValidComment($this->config["docid"],$this->config["tagid"],$id)) {
      ////////////////////////////////////
      		switch ($action) {
      			case "delete":
      				$pObj->Comment($id);
      ....
      ?>

        God loves me. 【ツ】


        MODX.ir (Persian Support)

        Boplo.ir/modx/ (Persian)