# wt-security/2.1.4/library/Session.php

WebTotem Security, version 2.1.4. 42 lines.

- Page: https://pluginprobe.com/plugins/wt-security/2.1.4/code/library/Session.php
- Raw: https://pluginprobe.com/plugins/wt-security/2.1.4/raw/library/Session.php
- Modified: 2020-05-26T09:04:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wt-security/2.1.4/code/library/Session.php#L10-L20`.

```php
<?php defined('ABSPATH') or die("Protected By WT!");


class WTSEC_LIBRARY_Session
{
    public static function notifications()
    {
        $notification_types = [
            "error","info","warning","success"
        ];
        foreach ($notification_types as $type) {
            if ($notifications = get_option(WTSEC_PLUGIN_PREFIX.$type)) {
                if(is_array($notifications)) {
                    foreach ($notifications as $notification) {
                        echo '<div class="ww-main ww-main--grid" id="ww-alert" title="" data-tlite="">
          <div class="ww-alert ww-alert--'.$type.'" title="" data-tlite="">
            <div class="ww-alert__info">'.strtoupper($type).':</div>
            <div class="ww-alert__text" title="" data-tlite="">'.$notification.'</div><button class="ww-alert__close" type="button" onclick="removeAlert()">
              <div class="ww-icon ww-icon--close"></div>
            </button>
          </div>
        </div>';
                    }
                }
                self::deleteNotification($type);
            }
        }
    }

    protected static function deleteNotification($name){
        return delete_option(WTSEC_PLUGIN_PREFIX.$name);
    }

    public static function setNotification($type,$value){
        if($notifications = get_option(WTSEC_PLUGIN_PREFIX.$type)){
            $notifications[] = $value;
            update_option(WTSEC_PLUGIN_PREFIX.$type,$notifications);
        }else{
            update_option(WTSEC_PLUGIN_PREFIX.$type,[$value]);
        }
    }
}
```
