Jump to content
  • 0

If Not Logged In Not Displaying?


Ken Ng

Question

Hi,

 

Not sure if it's me just having this problem. I edited download manager client_main.pdt to show message if client is not logged, then show you must login to download. It is showing if client is not logged in, however when user logged in, it shows the message as well.

 

Any advice on this?

<?php if (!$this->Html->ifSet($logged_in)) { ?>
<div class="col-md-12">
<p>You must logged in to download. Click <a href="<?php echo $this->Html->safe($this->client_uri . "login/");?>">here</a> to login</p>
</div>
<div class="clearfix"></div>
<?php } ?>
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

The variable $logged_in doesn't exist in the view. It is not set, and by default Html::ifSet returns an empty string. This evaluates to boolean false. Your condition negates this value, so the condition is always boolean true. That is why your text is always shown.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...